Bug : New palette name was set to object MouseEvent ! :)

This commit is contained in:
jdescottes 2014-04-02 22:53:58 +02:00
parent 1ce633bd06
commit 644b72cc6e

View File

@ -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');