better (but still broken) removal from playgrounds
This commit is contained in:
@@ -328,4 +328,10 @@
|
||||
|
||||
(defCommand SwitchPlayground [name (Text null)]
|
||||
(archive.changePlaygrounds ->:Void [:DynamicAccess<Dynamic> p] (dictSet p "default" name))
|
||||
(when playgroundSystem (playgroundSystem.switchPlaygroundKey name))))
|
||||
(when playgroundSystem (playgroundSystem.switchPlaygroundKey name)))
|
||||
|
||||
(defCommand RemoveFromPlayground [entries (SelectedEntries 1 null)]
|
||||
(for e entries
|
||||
(when (hasComponent e Positions)
|
||||
(withWritableComponents archive e [positions Positions]
|
||||
(positions.remove (dictGet archive.playgrounds "default")))) e)))
|
||||
|
@@ -5,7 +5,8 @@
|
||||
|
||||
(defNew [&prop :ArchiveUI ui
|
||||
:EntryChecker canProcess
|
||||
&prop :PlaygroundEntryProcessor processor]
|
||||
&prop :PlaygroundEntryProcessor processor
|
||||
:EntryProcessor onRemoveEntry]
|
||||
|
||||
(super
|
||||
->[archive e]
|
||||
@@ -21,7 +22,8 @@
|
||||
(return null))))
|
||||
(whenLet [pos (dictGet (readComponent e Positions) _playgroundKey)]
|
||||
(processor archive e pos ui))
|
||||
}))
|
||||
})
|
||||
(set this.onRemoveEntry onRemoveEntry))
|
||||
|
||||
(method switchPlaygroundKey [key]
|
||||
(when _playgroundKey
|
||||
|
Reference in New Issue
Block a user