Synchronizes selected company on 1099 page to everything else.
This commit is contained in:
@@ -71,29 +71,23 @@ z.input.addEventListener(\"selection\", function (event) {
|
||||
z.input.value = event.detail.selection.value.value;
|
||||
document.getElementById(\"company-search-value\").value= event.detail.selection.value.key;
|
||||
document.getElementById(\"company-search-value\").dispatchEvent(new Event('change'));
|
||||
|
||||
});
|
||||
"))]])))
|
||||
|
||||
#_{:hx-get
|
||||
(bidi/path-for ssr-routes/only-routes
|
||||
:company-dropdown-contents)
|
||||
:hx-target "#company-dropdown .navbar-dropdown"
|
||||
:hx-swap "outerHTML"
|
||||
"_" (hiccup/raw
|
||||
"on click
|
||||
toggle .is-active on <#company-dropdown />
|
||||
end
|
||||
")
|
||||
}
|
||||
(defn dropdown [request]
|
||||
|
||||
(let [client (get-in request [:session :client])]
|
||||
|
||||
(navbar-dropdown
|
||||
"company-dropdown"
|
||||
(if client
|
||||
(str "Company: " (:client/name client))
|
||||
"Company")
|
||||
[:span
|
||||
(if client
|
||||
(str "Company: " (:client/name client))
|
||||
"Company")
|
||||
[:script
|
||||
(hiccup/raw
|
||||
"localStorage.setItem(\"last-client-id\", \""(:db/id client)"\")")]]
|
||||
[:div {:hx-get
|
||||
(bidi/path-for ssr-routes/only-routes
|
||||
:company-dropdown-contents)
|
||||
@@ -103,17 +97,7 @@ document.getElementById(\"company-search-value\").dispatchEvent(new Event('chang
|
||||
:style {:width "20em"
|
||||
:height "80px"}
|
||||
}
|
||||
[:div.loader.is-loading.is-active.is-centered]]
|
||||
)
|
||||
#_[:div#company-dropdown.navbar-item.has-dropdown
|
||||
{"_" (hiccup/raw
|
||||
"on click elsewhere
|
||||
remove .is-active from <#company-dropdown />
|
||||
end "
|
||||
)} ;; remove .is-active from <#company-dropdown />
|
||||
|
||||
[:div.navbar-dropdown]
|
||||
]))
|
||||
[:div.loader.is-loading.is-active.is-centered]])))
|
||||
|
||||
(defn active-client [{:keys [identity params] :as request}]
|
||||
(clojure.pprint/pprint params)
|
||||
|
||||
Reference in New Issue
Block a user