mirror of
https://github.com/penpot/penpot.git
synced 2025-03-13 00:01:51 -05:00
🐛 Fix In history panel, If I click on the arrow to see more, it undoes until that change
This commit is contained in:
parent
0da51d878f
commit
238519cb69
1 changed files with 15 additions and 3 deletions
|
@ -8,12 +8,14 @@
|
||||||
(:require-macros [app.main.style :as stl])
|
(:require-macros [app.main.style :as stl])
|
||||||
(:require
|
(:require
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
|
[app.common.data.macros :as dm]
|
||||||
[app.main.data.events :as ev]
|
[app.main.data.events :as ev]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.data.workspace.common :as dwc]
|
[app.main.data.workspace.common :as dwc]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :refer [t] :as i18n]
|
[app.util.i18n :refer [t] :as i18n]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
|
@ -283,8 +285,18 @@
|
||||||
nil)]))
|
nil)]))
|
||||||
|
|
||||||
(mf/defc history-entry [{:keys [locale entry idx-entry disabled? current?]}]
|
(mf/defc history-entry [{:keys [locale entry idx-entry disabled? current?]}]
|
||||||
|
{::mf/props :obj}
|
||||||
(let [hover? (mf/use-state false)
|
(let [hover? (mf/use-state false)
|
||||||
show-detail? (mf/use-state false)]
|
show-detail? (mf/use-state false)
|
||||||
|
toggle-show-detail
|
||||||
|
(mf/use-fn
|
||||||
|
(fn [event]
|
||||||
|
(let [has-entry? (-> (dom/get-current-target event)
|
||||||
|
(dom/get-data "has-entry")
|
||||||
|
(parse-boolean))]
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(when has-entry?
|
||||||
|
(swap! show-detail? not)))))]
|
||||||
[:div {:class (stl/css-case :history-entry true
|
[:div {:class (stl/css-case :history-entry true
|
||||||
:disabled disabled?
|
:disabled disabled?
|
||||||
:current current?
|
:current current?
|
||||||
|
@ -301,8 +313,8 @@
|
||||||
(when (:detail entry)
|
(when (:detail entry)
|
||||||
[:div {:class (stl/css-case :history-entry-summary-button true
|
[:div {:class (stl/css-case :history-entry-summary-button true
|
||||||
:button-opened @show-detail?)
|
:button-opened @show-detail?)
|
||||||
:on-click #(when (:detail entry)
|
:on-click toggle-show-detail
|
||||||
(swap! show-detail? not))}
|
:data-has-entry (dm/str (not (nil? (:detail entry))))}
|
||||||
i/arrow-refactor])]
|
i/arrow-refactor])]
|
||||||
|
|
||||||
(when @show-detail?
|
(when @show-detail?
|
||||||
|
|
Loading…
Add table
Reference in a new issue