diff options
-rw-r--r-- | src/frontend/tubo/events.cljs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/frontend/tubo/events.cljs b/src/frontend/tubo/events.cljs index a48a001..a989dcc 100644 --- a/src/frontend/tubo/events.cljs +++ b/src/frontend/tubo/events.cljs @@ -68,6 +68,12 @@ (set! (.. js/document.body -style -overflow) (if active "hidden" "auto")))) (rf/reg-fx + ::scroll-into-view! + (fn [element] + (when element + (.scrollIntoView element (js-obj "behavior" "smooth"))))) + +(rf/reg-fx ::document-title! (fn [title] (set! (.-title js/document) (str title " - Tubo")))) @@ -194,6 +200,11 @@ ::body-overflow! (not (:show-media-queue db))})) (rf/reg-event-fx + ::scroll-into-view + (fn [{:keys [db]} [_ element]] + {::scroll-into-view! element})) + +(rf/reg-event-fx ::change-volume-level [(rf/inject-cofx :store)] (fn [{:keys [db store]} [_ value player]] |