piskel/src/js/controller/dialogs/AbstractDialogController.js

25 lines
730 B
JavaScript
Raw Normal View History

(function () {
var ns = $.namespace('pskl.controller.dialogs');
ns.AbstractDialogController = function () {};
ns.AbstractDialogController.prototype.init = function () {
this.closeButton = document.querySelector('.dialog-close');
this.closeButton.addEventListener('click', this.closeDialog.bind(this));
};
ns.AbstractDialogController.prototype.destroy = function () {};
ns.AbstractDialogController.prototype.closeDialog = function () {
this.destroy();
$.publish(Events.DIALOG_HIDE);
};
2014-09-18 09:18:07 +04:00
ns.AbstractDialogController.prototype.setTitle = function (title) {
2014-09-20 11:14:21 +04:00
var dialogTitle = document.querySelector('.dialog-title');
if (dialogTitle) {
dialogTitle.innerText = title;
2014-09-18 09:18:07 +04:00
}
};
})();