feat(mobile): add priority toggle button to toolbar

This commit is contained in:
leizhe
2022-01-04 10:35:21 +08:00
committed by Andelf
parent 8f73d27eda
commit 7a8aa9329c
3 changed files with 33 additions and 0 deletions

View File

@@ -46,6 +46,7 @@
[frontend.util.marker :as marker]
[frontend.util.page-property :as page-property]
[frontend.util.property :as property]
[frontend.util.priority :as priority]
[frontend.util.thingatpt :as thingatpt]
[frontend.util.list :as list]
[goog.dom :as gdom]
@@ -915,6 +916,17 @@
(util/format "[#%s]" new-priority))]
(save-block-if-changed! block new-content)))
(defn cycle-priority!
[]
(when (state/get-edit-block)
(let [format (or (db/get-page-format (state/get-current-page))
(state/get-preferred-format))
input-id (state/get-edit-input-id)
content (state/get-edit-content)
new-priority (priority/cycle-priority-state content)
new-value (priority/add-or-update-priority content format new-priority)]
(state/set-edit-content! input-id new-value))))
(defn delete-block-aux!
[{:block/keys [uuid repo] :as _block} children?]
(let [repo (or repo (state/get-current-repo))