-
-
Save frankhale/7721146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn actions [array-of-funcs] | |
(doseq [func array-of-funcs] (func))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn show-dropdown [e] | |
(this-as button | |
(let [$button (js/$ button)] | |
(.preventDefault e) | |
(remove-dropdown) | |
(.addClass (.parents $button ".dropdown") "open")))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn show-dropdown [e] | |
(this-as button | |
(let [$button (js/$ button)] | |
(actions | |
(array (fn [] (.preventDefault e)) | |
(fn [] (remove-dropdown)) | |
(fn [] (.addClass (.parents $button ".dropdown") "open"))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment