Fix : fix classes extending simplePen

This commit is contained in:
jdescottes
2014-07-02 07:34:07 +02:00
parent d126023c4a
commit 8a70943b09
4 changed files with 33 additions and 15 deletions

View File

@ -42,18 +42,25 @@
evt.stopPropagation();
var name = this.getName();
var description = this.getDescription();
var isPublic = !!this.isPublicCheckbox.prop('checked');
var descriptor = new pskl.model.piskel.Descriptor(name, description, isPublic);
this.piskelController.getPiskel().setDescriptor(descriptor);
if (!name) {
name = window.prompt('Please specify a name', 'New piskel');
}
this.beforeSaving_();
pskl.app.storageService.store({
success : this.onSaveSuccess_.bind(this),
error : this.onSaveError_.bind(this),
after : this.afterSaving_.bind(this)
});
if (name) {
var description = this.getDescription();
var isPublic = !!this.isPublicCheckbox.prop('checked');
var descriptor = new pskl.model.piskel.Descriptor(name, description, isPublic);
this.piskelController.getPiskel().setDescriptor(descriptor);
this.beforeSaving_();
pskl.app.storageService.store({
success : this.onSaveSuccess_.bind(this),
error : this.onSaveError_.bind(this),
after : this.afterSaving_.bind(this)
});
}
};
ns.SaveController.prototype.onSaveLocalClick_ = function (evt) {