diff --git a/src/js/controller/dialogs/PaletteManagerController.js b/src/js/controller/dialogs/PaletteManagerController.js index 91692105..9332f7b4 100644 --- a/src/js/controller/dialogs/PaletteManagerController.js +++ b/src/js/controller/dialogs/PaletteManagerController.js @@ -35,7 +35,7 @@ // Delegated event listener for events repeated on all cards this.paletteBody.addEventListener('click', this.delegatedPaletteBodyClick.bind(this)); this.paletteHead.addEventListener('click', this.delegatedPaletteHeadClick.bind(this)); - this.createButton.addEventListener('click', this.createPalette.bind(this)); + this.createButton.addEventListener('click', this.onCreateClick_.bind(this)); this.saveAllButton.addEventListener('click', this.saveAll.bind(this)); this.closeButton.addEventListener('click', this.closeDialog.bind(this)); @@ -56,6 +56,10 @@ $.publish(Events.DIALOG_HIDE); }; + ns.PaletteManagerController.prototype.onCreateClick_ = function (evt) { + this.createPalette(); + }; + ns.PaletteManagerController.prototype.createPalette = function (name) { if (!name) { name = window.prompt('Please enter a name for your palette', 'New palette');