working on making splitting accounts work properly.

This commit is contained in:
Bryce Covert
2018-06-04 21:24:26 -07:00
parent 2f744be36c
commit b571e9a726
2 changed files with 22 additions and 3 deletions

View File

@@ -273,10 +273,20 @@
.typeahead {
position:relative;
overflow:visible;
}
.modal {
overflow: visible;
}
.modal-card-body {
overflow: visible;
}
.typeahead-menu {
position: absolute;
position:absolute;
display: inline-block;
width: 100%;
top: 100%;
@@ -296,7 +306,8 @@
border-radius: 4px;
-webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
background-clip: padding-box;
/* background-clip: padding-box; */
}
.typeahead-suggestion {

View File

@@ -279,6 +279,14 @@
(update-in db [::change-expense-accounts :invoice :expense-accounts]
conj {:amount 0 :expense-account-id nil})))
(re-frame/reg-event-db
::remove-expense-account-split
(fn [db [_ index]]
(update-in db [::change-expense-accounts :invoice :expense-accounts]
(fn [expense-accounts]
(concat (take index expense-accounts)
(drop (inc index) expense-accounts))))))
(defn change-expense-accounts-modal []
(let [{{:keys [expense-accounts]} :invoice :as data} @(re-frame/subscribe [::change-expense-accounts])
change-event [::events/change-form [::change-expense-accounts]]]
@@ -323,7 +331,7 @@
:max (:total data)
:step "0.01"}]]]]]]
[:td [:a.button [:i.fa.fa-times]]]]
[:td [:a.button {:on-click (dispatch-event [::remove-expense-account-split index])} [:i.fa.fa-times]]]]
)]]]))