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

View File

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

View File

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