SAAS-1184 - bugfixes and polish

This commit is contained in:
Duncan Sommerville 2015-11-10 15:10:36 -05:00
parent f352b61707
commit bb7f8c1ed3
10 changed files with 105 additions and 24 deletions

View file

@ -136,6 +136,13 @@ var AIRTIME = (function(AIRTIME){
});
};
/**
* Internal destructor. Can be assigned via assignOnCloseHandler
*
* @private
*/
Tab.prototype._destroy = function () {}
/**
* Assign the given function f as the click handler for the tab
*
@ -164,6 +171,15 @@ var AIRTIME = (function(AIRTIME){
this.tab.find(".lib_pl_close").unbind("click").click(f);
};
/**
* Assign an implicit destructor
*
* @param {function} fn function to run when this Tab is destroyed
*/
Tab.prototype.assignOnCloseHandler = function (fn) {
this._destroy = fn;
};
/**
* Open this tab in the right-hand pane and set it as the currently active tab
*/
@ -205,6 +221,8 @@ var AIRTIME = (function(AIRTIME){
} else {
mod.onResize();
}
self._destroy();
};
/**