Commit ad9217d 0 parents commit ad9217d Copy full SHA for ad9217d
File tree 6 files changed +45
-0
lines changed
6 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ .nrepl-port
2
+ target
Original file line number Diff line number Diff line change
1
+ [
2
+ [:app :lt.objs.plugins/load-js "mermaid_compiled.js"]
3
+ [:myplugin.hello :lt.plugins.mermaid/on-close-destroy]
4
+ ]
Original file line number Diff line number Diff line change
1
+ {:name " mermaid"
2
+ :version " 0.0.1"
3
+ :author " "
4
+ :source " "
5
+ :desc " "
6
+ :behaviors " mermaid.behaviors" }
Original file line number Diff line number Diff line change
1
+ (defproject mermaid " 0.0.1"
2
+ :dependencies [[org.clojure/clojure " 1.5.1" ]])
Original file line number Diff line number Diff line change
1
+ (ns lt.plugins.mermaid
2
+ (:require [lt.object :as object]
3
+ [lt.objs.tabs :as tabs]
4
+ [lt.objs.command :as cmd])
5
+ (:require-macros [lt.macros :refer [defui behavior]]))
6
+
7
+ (defui hello-panel [this]
8
+ [:h1 " Hello from mermaid" ])
9
+
10
+ (object/object* ::mermaid.hello
11
+ :tags [:mermaid.hello ]
12
+ :behaviors [::on-close-destroy ]
13
+ :name " mermaid"
14
+ :init (fn [this]
15
+ (hello-panel this)))
16
+
17
+ (behavior ::on-close-destroy
18
+ :triggers #{:close }
19
+ :desc " mermaid: Close tab and tabset as well if last tab"
20
+ :reaction (fn [this]
21
+ (when-let [ts (:lt.objs.tabs/tabset @this)]
22
+ (when (= (count (:objs @ts)) 1 )
23
+ (tabs/rem-tabset ts)))
24
+ (object/raise this :destroy )))
25
+
26
+ (def hello (object/create ::mermaid.hello ))
27
+
28
+ (cmd/command {:command ::say-hello
29
+ :desc " mermaid: Say Hello"
30
+ :exec (fn []
31
+ (tabs/add-or-focus! hello))})
You can’t perform that action at this time.
0 commit comments