mirror of
https://github.com/penpot/penpot.git
synced 2025-04-01 01:21:21 -05:00
🐛 Fix history panel doesn't close on esc
This commit is contained in:
parent
fc4221b047
commit
21f4abf1b8
2 changed files with 28 additions and 1 deletions
26
frontend/src/app/main/data/workspace/history.cljs
Normal file
26
frontend/src/app/main/data/workspace/history.cljs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
;;
|
||||||
|
;; Copyright (c) KALEIDOS INC
|
||||||
|
|
||||||
|
(ns app.main.data.workspace.history
|
||||||
|
(:require
|
||||||
|
[app.main.data.workspace.common :as dwc]
|
||||||
|
[app.main.data.workspace.layout :as dwl]
|
||||||
|
[beicon.v2.core :as rx]
|
||||||
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
|
|
||||||
|
(defn initialize-history
|
||||||
|
[]
|
||||||
|
(ptk/reify ::initialize-history
|
||||||
|
ptk/WatchEvent
|
||||||
|
(watch [_ _ stream]
|
||||||
|
(let [clear-history-mode #(dwl/remove-layout-flag :document-history)]
|
||||||
|
(rx/merge
|
||||||
|
(rx/of (dwl/toggle-layout-flag :document-history))
|
||||||
|
(->> stream
|
||||||
|
(rx/filter dwc/interrupt?)
|
||||||
|
(rx/take 1)
|
||||||
|
(rx/map clear-history-mode)))))))
|
|
@ -14,6 +14,7 @@
|
||||||
[app.main.data.shortcuts :as scd]
|
[app.main.data.shortcuts :as scd]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.data.workspace.drawing.common :as dwc]
|
[app.main.data.workspace.drawing.common :as dwc]
|
||||||
|
[app.main.data.workspace.history :as dwh]
|
||||||
[app.main.data.workspace.shortcuts :as sc]
|
[app.main.data.workspace.shortcuts :as sc]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
|
@ -197,7 +198,7 @@
|
||||||
(st/emit! :interrupt
|
(st/emit! :interrupt
|
||||||
(dw/clear-edition-mode)))
|
(dw/clear-edition-mode)))
|
||||||
|
|
||||||
(st/emit! (-> (dw/toggle-layout-flag :document-history)
|
(st/emit! (-> (dwh/initialize-history)
|
||||||
(vary-meta assoc ::ev/origin "workspace-header")))))
|
(vary-meta assoc ::ev/origin "workspace-header")))))
|
||||||
|
|
||||||
open-share-dialog
|
open-share-dialog
|
||||||
|
|
Loading…
Add table
Reference in a new issue