BootstrapDialog improvements and design

This commit is contained in:
Ezequiel Bergamaschi 2014-09-14 17:45:11 -03:00
parent 616b782c5d
commit c78ae247f4
3 changed files with 8 additions and 21 deletions

View File

@ -79,15 +79,12 @@ var BootstrapDialog = new Class({
}, },
onAcceptClick: function(event) { onAcceptClick: function(event) {
//this method should be abstract throw "Unsupported operation";
}, },
onDialogShown: function() { onDialogShown: function() {},
},
onRemoveClick: function(event) { onRemoveClick: function(event) {
event.data.model.setValue(null); throw "Unsupported operation";
event.data.dialog.close();
}, },
show: function () { show: function () {
@ -95,8 +92,9 @@ var BootstrapDialog = new Class({
}, },
setContent: function(content) { setContent: function(content) {
// faltaria remover body previo var modalBody = this._native.find('.modal-body');
this._native.find('.modal-body').append(content); modalBody.empty();
modalBody.append(content);
}, },
css: function(options){ css: function(options){
@ -114,9 +112,5 @@ var BootstrapDialog = new Class({
cleanError: function(){ cleanError: function(){
this._native.find('.alert-danger').hide(); this._native.find('.alert-danger').hide();
},
showRemoveButton: function(){
this.removeButton.show();
} }
}); });

View File

@ -26,7 +26,7 @@ mindplot.widget.LinkEditor = new Class({
cancelButton: true, cancelButton: true,
closeButton: true, closeButton: true,
acceptButton: true, acceptButton: true,
removeButton: true, removeButton: typeof model.getValue() != 'undefined',
errorMessage: true, errorMessage: true,
onRemoveClickData: {model: this._model} onRemoveClickData: {model: this._model}
}); });
@ -97,10 +97,6 @@ mindplot.widget.LinkEditor = new Class({
} }
); );
if (typeof model.getValue() != 'undefined'){
this.showRemoveButton();
}
result.append(this.form); result.append(this.form);
return result; return result;
}, },

View File

@ -26,7 +26,7 @@ mindplot.widget.NoteEditor = new Class({
cancelButton: true, cancelButton: true,
closeButton: true, closeButton: true,
acceptButton: true, acceptButton: true,
removeButton: true, removeButton: typeof model.getValue() != 'undefined',
onRemoveClickData: {model: this._model} onRemoveClickData: {model: this._model}
}); });
this.css({margin:"150px auto"}); this.css({margin:"150px auto"});
@ -72,9 +72,6 @@ mindplot.widget.NoteEditor = new Class({
}); });
}); });
if (typeof model.getValue() != 'undefined'){
this.showRemoveButton();
}
result.append(form); result.append(form);
return result; return result;
}, },