piskel/src/js/controller/dialogs/AbstractDialogController.js
2015-04-14 18:02:33 +02:00

25 lines
730 B
JavaScript

(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);
};
ns.AbstractDialogController.prototype.setTitle = function (title) {
var dialogTitle = document.querySelector('.dialog-title');
if (dialogTitle) {
dialogTitle.innerText = title;
}
};
})();