source: [view]
this._set("closeButton", disp);
dojo.toggleClass(this.innerDiv, "dijitClosable", disp);
this.closeNode.style.display = disp ? "" : "none";
if(disp){
var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
if(this.closeNode){
dojo.attr(this.closeNode,"title", _nlsResources.itemClose);
}
// add context menu onto title button
var _nlsResources = dojo.i18n.getLocalization("dijit", "common");
this._closeMenu = new dijit.Menu({
id: this.id+"_Menu",
dir: this.dir,
lang: this.lang,
targetNodeIds: [this.domNode]
});
this._closeMenu.addChild(new dijit.MenuItem({
label: _nlsResources.itemClose,
dir: this.dir,
lang: this.lang,
onClick: dojo.hitch(this, "onClickCloseButton")
}));
}else{
if(this._closeMenu){
this._closeMenu.destroyRecursive();
delete this._closeMenu;
}
}