Created
February 4, 2016 19:07
-
-
Save thollingshead/8be2dde53b4a48f91e5f to your computer and use it in GitHub Desktop.
Sublime snippet for Dojo templated widget boilerplate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
define([ | |
'dijit/_TemplatedMixin', | |
'dijit/_WidgetBase', | |
'dojo/_base/declare', | |
${2: | |
'dojo/i18n!./$1/nls/resources',} | |
'dojo/text!./$1/templates/$1.html'${5:, | |
'xstyle/css!./$1/css/$1.css'} | |
], function( | |
_TemplatedMixin, _WidgetBase, | |
declare, | |
${3:nls, }template${6:, | |
stylesheet} | |
) { | |
return declare([_WidgetBase, _TemplatedMixin], {${7: | |
baseClass: '$1',} | |
templateString: template, | |
// Widget LifeCycle${8: | |
constructor: function() \{${4: | |
this.nls = declare.safeMixin(this.nls || \{\}, nls);} | |
$9 | |
\},}${10: | |
postMixInProperties: function() \{ | |
this.inherited(arguments);$11 | |
\},}${12: | |
buildRendering: function() \{ | |
this.inherited(arguments);$13 | |
\},}${14: | |
postCreate: function() \{ | |
this.inherited(arguments);$15 | |
\},}${16: | |
startup: function() \{ | |
this.inherited(arguments);$17 | |
\},}${18: | |
destroy: function() \{ | |
this.inherited(arguments);$19 | |
\}}$20 | |
}); | |
}); | |
]]></content> | |
<tabTrigger>define()</tabTrigger> | |
<scope>source.js</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment