Skip to content

Instantly share code, notes, and snippets.

@odoe
Created May 18, 2015 17:59
Show Gist options
  • Select an option

  • Save odoe/bf22f0ffffae42f488c0 to your computer and use it in GitHub Desktop.

Select an option

Save odoe/bf22f0ffffae42f488c0 to your computer and use it in GitHub Desktop.
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'stores/LocatorStore',
'helpers/NumFormatter',
'dojo/text!./templates/LocatorView.html'
], function(
declare,
_WidgetBase, _TemplatedMixin,
store, format,
template
) {
var fixed = format(3);
return declare([_WidgetBase, _TemplatedMixin], {
templateString: template,
postCreate: function() {
store.subscribe(function(state) {
this.yNode.innerHTML = fixed(state.y);
this.xNode.innerHTML = fixed(state.x);
}.bind(this));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment