Skip to content

Instantly share code, notes, and snippets.

@thollingshead
Created February 4, 2016 19:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thollingshead/8be2dde53b4a48f91e5f to your computer and use it in GitHub Desktop.
Save thollingshead/8be2dde53b4a48f91e5f to your computer and use it in GitHub Desktop.
Sublime snippet for Dojo templated widget boilerplate
<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