-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript_backbone_marionette.snippets
91 lines (82 loc) · 1.44 KB
/
javascript_backbone_marionette.snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#
# Backbone.Marionette JS snippets
#
# http://marionettejs.com/
#
extends javascript
snippet .ui "UI Property for Marionette View"
/**
* Maps ui elements to avoid duplicating the selectors.
*
* @type {Object}
*/
ui: {
${1:name}: '${2:selector}'$0
},
endsnippet
snippet .modelEvents "ModelEvents Property for Marionette View"
/**
* Binds model events to functions.
*
* @type {Object}
*/
modelEvents: {
'${1:events}': '${2: methodName}'
},
endsnippet
snippet .template "Template Property for Marionette View"
/**
* The template used to render this layout.
*
* @type {Function}
*/
template: Template,
endsnippet
snippet .className "Classname Property for Marionette View"
/**
* Class to append to the DOM element containing the layout.
*
* @type {String}
*/
className: '${1:className}',
endsnippet
snippet .initialize "Initialize Method for Marionette View"
/**
* Initializes the view. $1
*
* @type {Function}
*/
initialize: function() {
$2
},
endsnippet
snippet .onShow "onShow Method for Marionette View"
/**
* Instantiates the views and assigns them to their regions. $1
*
* @type {Function}
*/
onShow: function() {
$2
}
endsnippet
snippet .onRender "onRender Method for Marionette View"
/**
* Triggered after the view has been rendered.$1
*
* @type {Function}
*/
onRender: function() {
$2
}
endsnippet
snippet .func "Generic class method"
/**
* $1
*
* @type {Function}
*/
${2:methodName}: function() {
$3
},
endsnippet