|
|
@@ -218,44 +218,30 @@
|
|
|
|
|
|
(defmethod handle :mobile/keyboard-will-show [[_ keyboard-height]]
|
|
|
(let [main-node (util/app-scroll-container-node)]
|
|
|
- (state/set-state! :mobile/show-tabbar? false)
|
|
|
- (state/set-state! :mobile/show-toolbar? true)
|
|
|
(state/set-state! :mobile/show-action-bar? false)
|
|
|
(when (= (state/sub :editor/record-status) "RECORDING")
|
|
|
(state/set-state! :mobile/show-recording-bar? true))
|
|
|
(when-let [^js html (js/document.querySelector ":root")]
|
|
|
(.setProperty (.-style html) "--ls-native-kb-height" (str keyboard-height "px"))
|
|
|
- (.add (.-classList html) "has-mobile-keyboard"))
|
|
|
+ (.add (.-classList html) "has-mobile-keyboard")
|
|
|
+ (.setProperty (.-style html) "--ls-native-toolbar-opacity" 1))
|
|
|
(when (mobile-util/native-ios?)
|
|
|
(reset! util/keyboard-height keyboard-height)
|
|
|
(set! (.. main-node -style -marginBottom) (str keyboard-height "px"))
|
|
|
- (when-let [left-sidebar-node (gdom/getElement "left-sidebar")]
|
|
|
- (set! (.. left-sidebar-node -style -bottom) (str keyboard-height "px")))
|
|
|
- (when-let [right-sidebar-node (gdom/getElementByClass "sidebar-item-list")]
|
|
|
- (set! (.. right-sidebar-node -style -paddingBottom) (str (+ 150 keyboard-height) "px")))
|
|
|
- (when-let [card-preview-el (js/document.querySelector ".cards-review")]
|
|
|
- (set! (.. card-preview-el -style -marginBottom) (str keyboard-height "px")))
|
|
|
- (when-let [card-preview-el (js/document.querySelector ".encryption-password")]
|
|
|
- (set! (.. card-preview-el -style -marginBottom) (str keyboard-height "px")))
|
|
|
- (js/setTimeout (fn []
|
|
|
- (when-let [toolbar (.querySelector main-node "#mobile-editor-toolbar")]
|
|
|
- (set! (.. toolbar -style -bottom) (str keyboard-height "px"))))
|
|
|
- 100))))
|
|
|
+ (when-let [toolbar (.querySelector main-node "#mobile-editor-toolbar")]
|
|
|
+ (set! (.. toolbar -style -bottom) (str keyboard-height "px"))))))
|
|
|
|
|
|
(defmethod handle :mobile/keyboard-will-hide [[_]]
|
|
|
(let [main-node (util/app-scroll-container-node)]
|
|
|
- (state/set-state! :mobile/show-toolbar? false)
|
|
|
- (state/set-state! :mobile/show-tabbar? true)
|
|
|
(when (= (state/sub :editor/record-status) "RECORDING")
|
|
|
(state/set-state! :mobile/show-recording-bar? false))
|
|
|
(when-let [^js html (js/document.querySelector ":root")]
|
|
|
(.removeProperty (.-style html) "--ls-native-kb-height")
|
|
|
+ (.setProperty (.-style html) "--ls-native-toolbar-opacity" 0)
|
|
|
(.remove (.-classList html) "has-mobile-keyboard"))
|
|
|
(when (mobile-util/native-ios?)
|
|
|
(when-let [card-preview-el (js/document.querySelector ".cards-review")]
|
|
|
(set! (.. card-preview-el -style -marginBottom) "0px"))
|
|
|
- (when-let [card-preview-el (js/document.querySelector ".encryption-password")]
|
|
|
- (set! (.. card-preview-el -style -marginBottom) "0px"))
|
|
|
(set! (.. main-node -style -marginBottom) "0px")
|
|
|
(when-let [left-sidebar-node (gdom/getElement "left-sidebar")]
|
|
|
(set! (.. left-sidebar-node -style -bottom) "0px"))
|