File tree 3 files changed +18
-18
lines changed
3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 68
68
[icon (if active? active-icon inactive-icon)]])
69
69
70
70
(defn toggle-collapsed-button
71
- [el- k collapsed?]
71
+ [k collapsed?]
72
72
[toggle-icon-button {:active? collapsed?
73
73
:active-icon " chevron-right"
74
74
:active-text " expand"
75
75
:class " small"
76
76
:inactive-icon " chevron-down"
77
77
:inactive-text " collapse"
78
78
:action #(rf/dispatch (if collapsed?
79
- [::document.e/expand-el el- k]
80
- [::document.e/collapse-el el- k]))}])
79
+ [::document.e/expand-el k]
80
+ [::document.e/collapse-el k]))}])
81
81
82
82
83
83
(defn radio-icon-button
Original file line number Diff line number Diff line change 31
31
new-db-store (pop db-store)
32
32
context' (-> (assoc context db-store-key new-db-store)
33
33
(assoc-coeffect :db original-db))
34
- db (get-effect context :db ::not-found )]
34
+ db (get-effect context :db ::not-found )]
35
35
(cond-> context'
36
36
(not= db ::not-found )
37
37
(assoc-effect :db (assoc-in original-db [:documents (:active-document original-db)] db))))))))
45
45
(rf/reg-event-db
46
46
::collapse-el
47
47
active-document-path
48
- (fn [db [_ el- k]]
49
- (update db :collapsed-keys conj el- k)))
48
+ (fn [db [_ k]]
49
+ (update db :collapsed-keys conj k)))
50
50
51
51
(rf/reg-event-db
52
52
::expand-el
53
53
active-document-path
54
- (fn [db [_ el- k]]
55
- (update db :collapsed-keys disj el- k)))
54
+ (fn [db [_ k]]
55
+ (update db :collapsed-keys disj k)))
56
56
57
57
(rf/reg-event-db
58
58
::toggle-filter
257
257
(rf/reg-event-db
258
258
::saved
259
259
(fn [db [_ document]]
260
- ; ; Update only the path, the title and the saved position of the document.
260
+ ; ; Update the path, the title and the saved position of the document.
261
261
; ; Any other changes that could happen while saving should be preserved.
262
262
(let [updates (select-keys document [:path :title :save ])]
263
263
(cond-> db
278
278
279
279
(rf/reg-event-db
280
280
::set-active
281
- (fn [db [_ document-id ]]
282
- (h/set-active db document-id )))
281
+ (fn [db [_ k ]]
282
+ (h/set-active db k )))
Original file line number Diff line number Diff line change 4
4
[renderer.utils.vec :as vec]))
5
5
6
6
(defn close
7
- [{:keys [active-document document-tabs] :as db} key ]
8
- (let [index (.indexOf document-tabs key )
9
- active-document (if (= active-document key )
7
+ [{:keys [active-document document-tabs] :as db} k ]
8
+ (let [index (.indexOf document-tabs k )
9
+ active-document (if (= active-document k )
10
10
(get document-tabs (if (zero? index)
11
11
(inc index)
12
12
(dec index)))
13
13
active-document)]
14
14
(-> db
15
- (update :document-tabs #(filterv (complement #{key }) %))
15
+ (update :document-tabs #(filterv (complement #{k }) %))
16
16
(assoc :active-document active-document)
17
- (update :documents dissoc key ))))
17
+ (update :documents dissoc k ))))
18
18
19
19
(defn expand-el
20
- [{:keys [active-document] :as db} el- k]
21
- (update-in db [:documents active-document :collapsed-keys ] disj el- k))
20
+ [{:keys [active-document] :as db} k]
21
+ (update-in db [:documents active-document :collapsed-keys ] disj k))
22
22
23
23
(defn add-recent
24
24
[db file-path]
You can’t perform that action at this time.
0 commit comments