Skip to content

Commit

Permalink
Remove unused string module, add hide/show checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Wilcox committed Jul 22, 2012
1 parent 3a2c955 commit b5270de
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ define([
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dx-alias/dom',
'dx-alias/string',
'dx-alias/on'
],function(declare, registry, _WidgetBase, _TemplatedMixin, dom, on){
],function(declare, registry, _WidgetBase, _TemplatedMixin, dom, string, on){
// summary:
// Widget is not very complicated, it's a shortcut for the most common
// Dijit creation modules, _WidgetBase, and _TemplatedMixin.
Expand All @@ -14,14 +15,24 @@ define([
return declare('dx-alias.Widget', [_WidgetBase, _TemplatedMixin], {
templateString:'<div></div>', //to be overwritten

showing: true,

show: function(){
if(this.showing) return;
this.showing = true;
dom.show(this.domNode);
},

hide: function(){
if(!this.showing) return;
this.showing = false;
dom.hide(this.domNode);
},

getName: function(){
return string.last(this.declaredClass, '.');
},

getParent: function(){
// summary:
// Returns the parent widget of this widget
Expand Down

0 comments on commit b5270de

Please sign in to comment.