File tree Expand file tree Collapse file tree 2 files changed +40
-11
lines changed
Expand file tree Collapse file tree 2 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ Ractive.components['logger'] = Ractive.extend do
2626 # title
2727 # message
2828 # callback: is fired when modal is closed. parameter: action.
29- show - dimmed : (ev , msg , callback ) ->
29+ showDimmed : (ev , msg , callback ) ->
3030 # print same message to the console for debugging purposes
3131 @logger .log msg
3232
Original file line number Diff line number Diff line change 11require ! './logger' : {Logger }
22
3- '''
3+ /*
44Usage
55 vlog = new VLogger this
66
7- answer, data <~ vlog.yesno
7+ answer, data <~ vlog.yesno do
88 title: 'Yes or No'
99 icon: 'map signs'
10- template: ' some ractive content '
1110 buttons:
1211 myaction:
13- ...
12+ text: 'My Action 2'
13+ color: \red
14+ icon: \remove
1415 myaction2:
15- ...
16- /* answer:
16+ text: 'My Action 2'
17+ color: \red
18+ icon: \remove
19+
20+ # Optionaly you can use a Ractive template
21+ # ------------------------------------------
22+ action, data <~ vlog.yesno do
23+ title: 'New Script'
24+ icon: ''
25+ closable: yes
26+ template: '''
27+ <span>Foo is : {{foo}}</span>
28+ <div class="ui input">
29+ <input value="{{filename}}" />
30+ </div>
31+ '''
32+ data:
33+ foo: "hello"
34+ buttons:
35+ create:
36+ text: 'Create'
37+ color: \green
38+ cancel:
39+ text: \Cancel
40+ color: \gray
41+ icon: \remove
42+
43+ # Here you will receive `data.filename` from the input.
44+
45+
46+
47+ answer:
1748 type: String of action,
1849 One of: keys of opts.buttons
1950 - or -
2051 "hidden" (if closed without action)
2152
22- data: Ractive.data if `template` is passed within the options
23- */
24-
25- '''
53+ data: Ractive.data if `template` is passed within the options
54+ */
2655
2756export class VLogger
2857 (@context , name )->
You can’t perform that action at this time.
0 commit comments