define([ "dojo/_base/declare", "dojo/on", "dojo/dom-class", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/text!./templates/TabContentPane.html" ], function (declare, on, domClass, _WidgetBase, _TemplatedMixin, template) { return declare("app.layout.TabContentPane", [_WidgetBase, _TemplatedMixin], { templateString: template, config: null, postCreate: function () { this.inherited(arguments); this._attachEventHandlers(); }, _attachEventHandlers: function () { var self = this; this.own( on(this.TabCloseButton, "click", function (e) { e.stopPropagation(); var bodyNode = document.getElementsByTagName("BODY"); if(bodyNode[0]) domClass.remove(bodyNode[0], "has-tab-open"); if(_Controller && _Controller.Sidebar) _Controller.Sidebar.updateSelectedTab(null); }) ); }, addChild: function(childRef) { if(childRef.domNode){ this.domNode.appendChild(childRef.domNode); } else if(childRef.tagName) { this.domNode.appendChild(childRef); } }, updateTitle: function(panelTitle) { if(!panelTitle || typeof panelTitle !== "string") return; this.TabTitle.innerHTML = panelTitle; } }); });