File tree Expand file tree Collapse file tree 4 files changed +12
-46
lines changed Expand file tree Collapse file tree 4 files changed +12
-46
lines changed Original file line number Diff line number Diff line change 217
217
(fn []
218
218
(let [handle-back!
219
219
(fn []
220
- (fstate/clear-edit! )
221
- (fstate/clear-selection! )
222
220
(cond
223
221
(seq (ui/get-modal ))
224
222
(ui/close-modal! )
225
223
224
+ (seq (fstate/get-selection-blocks ))
225
+ (fstate/clear-selection! )
226
+
226
227
:else
227
228
(-> (nav/nav-length? )
228
- (p/then (fn [len]
229
- (if (= len 1 )
230
- (.exitApp App)
231
- (nav/nav-pop! )))))))
229
+ (p/then (fn [len]
230
+ (if (= len 1 )
231
+ (.exitApp App)
232
+ (nav/nav-pop! ))))))
233
+ (fstate/clear-edit! ))
232
234
^js back-listener (.addListener App " backButton" handle-back!)]
233
235
#(.remove back-listener)))
234
236
[])
Original file line number Diff line number Diff line change 2
2
" Main ns for handling mobile start"
3
3
(:require [" @capacitor/app" :refer [^js App]]
4
4
[" @capacitor/keyboard" :refer [^js Keyboard]]
5
- [clojure.string :as string]
6
5
[frontend.handler.editor :as editor-handler]
7
6
[frontend.mobile.deeplink :as deeplink]
8
7
[frontend.mobile.intent :as intent]
33
32
(defn- android-init
34
33
" Initialize Android-specified event listeners"
35
34
[]
36
- ; ; patch back navigation
37
- (.addListener App " backButton"
38
- #(let [href js/window.location.href]
39
- (when (true ? (cond
40
- (state/settings-open? )
41
- (state/close-settings! )
42
-
43
- (state/modal-opened? )
44
- (state/close-modal! )
45
-
46
- (state/get-left-sidebar-open? )
47
- (state/set-left-sidebar-open! false )
48
-
49
- (state/action-bar-open? )
50
- (state/set-state! :mobile/show-action-bar? false )
51
-
52
- (not-empty (state/get-selection-blocks ))
53
- (editor-handler/clear-selection! )
54
-
55
- (state/editing? )
56
- (editor-handler/escape-editing )
57
-
58
- :else true ))
59
- (if (or (string/ends-with? href " #/" )
60
- (string/ends-with? href " /" )
61
- (not (string/includes? href " #/" )))
62
- (.exitApp App)
63
- (js/window.history.back )))))
64
-
65
35
(.addEventListener js/window " sendIntentReceived"
66
36
#(intent/handle-received )))
67
37
Original file line number Diff line number Diff line change 38
38
}
39
39
40
40
# mobile-editor-toolbar {
41
- @apply fixed bottom-0 left-0 w-full z-[9999 ] flex justify-between bg-gray-100 border-t border-gray-200;
41
+ @apply fixed - bottom-1 left-0 w-full z-[9999 ] flex justify-between bg-gray-100 border-t border-gray-200;
42
42
43
43
transform : translateY (calc (-1 * var (--ls-native-kb-height , 0 )));
44
44
Original file line number Diff line number Diff line change 35
35
[command-handler {:keys [icon class]} & [event?]]
36
36
[:div
37
37
[:button.bottom-action
38
- {:on-pointer-down (fn [e]
39
- (util/stop e)
38
+ {:on-mouse-down (fn [e]
40
39
(if event?
41
40
(command-handler e)
42
- (command-handler )))}
41
+ (command-handler ))
42
+ (util/stop e))}
43
43
(ui/icon icon {:size ui/icon-size :class class})]])
44
44
45
45
(rum/defc timestamp-submenu
55
55
(callback e))}
56
56
description])]
57
57
[:div
58
- [:button.bottom-action
59
- {:on-pointer-down (fn [event]
60
- (util/stop event)
61
- (let [target (gdom/getElement " mobile-toolbar-timestamp-submenu" )]
62
- (dom/add-class! target " show-submenu" )))}
63
- (ui/icon " calendar" {:size ui/icon-size})]
64
58
[:div#mobile-toolbar-timestamp-submenu.submenu
65
59
{:style {:bottom @util/keyboard-height}}
66
60
(command-cp #(let [today (page-handler/get-page-ref-text (date/today ))]
You can’t perform that action at this time.
0 commit comments