mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
* First sloppy import of code from heyarne/reagent-movable * Consistently use "current queue" to avoid confusion * Update shadow-cljs, re-frame and debux * Solve styling problem when sorting table rows * Make sortable component more reusable * Refactor playlist to use a sorted-map * Make sure current queue is displayed again * Fix sorting when converting a shuffled into a linear playlist * Implement set-current-track * Implement song-move in playlist * Add autoprefixer * Implement drag and drop reordering in current queue * Fix broken dev sass build * Bump some dependencies * Move airsonic-ui.views.icon to bulma.icon * Implement reusable dropdown in bulma.dropdown * Immediately render reordered tracks, reimplement actions in album view * Use new song-table on search result page * Make song-table more reusable * Remove current song * Implement go to source in current queue * Remove unused song view
20 lines
593 B
Clojure
20 lines
593 B
Clojure
(ns bulma.dropdown.events
|
|
(:require [re-frame.core :as rf]))
|
|
|
|
(defn show-dropdown [db [_ dropdown-id]]
|
|
(assoc-in db [:bulma :visible-dropdown] dropdown-id))
|
|
|
|
(rf/reg-event-db ::show show-dropdown)
|
|
|
|
(defn hide-dropdown [db _]
|
|
(update db :bulma dissoc :visible-dropdown))
|
|
|
|
(rf/reg-event-db ::hide hide-dropdown)
|
|
|
|
(defn toggle-dropdown [db [_ dropdown-id]]
|
|
(let [visible-dropdown (get-in db [:bulma :visible-dropdown])]
|
|
(if (= visible-dropdown dropdown-id)
|
|
(hide-dropdown db [::hide])
|
|
(show-dropdown db [::show dropdown-id]))))
|
|
|
|
(rf/reg-event-db ::toggle toggle-dropdown)
|