Moved resize+app settings to AbstractSettingController

This commit is contained in:
jdescottes
2015-02-23 00:23:11 +01:00
parent b4c1a4c714
commit 8592cd2e53
12 changed files with 71 additions and 40 deletions

View File

@@ -0,0 +1,26 @@
(function () {
var ns = $.namespace('pskl.controller.settings');
ns.AbstractSettingController = function () {};
ns.AbstractSettingController.prototype.addEventListener = function (el, type, callback) {
pskl.utils.Event.addEventListener(el, type, callback, this);
};
ns.AbstractSettingController.prototype.destroy = function () {
pskl.utils.Event.removeAllEventListeners(this);
this.nullifyDomReferences_();
};
ns.AbstractSettingController.prototype.nullifyDomReferences_ = function () {
for (var key in this) {
if (this.hasOwnProperty(key)) {
var isHTMLElement = this[key] && this[key].nodeName;
if (isHTMLElement) {
this[key] = null;
}
}
}
};
})();