[IMP] during image upload, disable save button
hide it and replace it with a button telling the user what we're currently doing (uploading the image). Leave the possibility of discarding the whole thing and going away though. bzr revid: xmo@openerp.com-20131106152412-eb283vghb18aafyr
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
@charset "utf-8";
|
||||
/* ---- CKEditor Minimal Reset ---- */
|
||||
.navbar.navbar-inverse .cke_chrome {
|
||||
border: none;
|
||||
@@ -239,6 +238,14 @@ ul.oe_menu_editor li.mjs-nestedSortable-expanded > div > .disclose > span:before
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.modal.nosave .modal-footer button.save {
|
||||
display: none;
|
||||
}
|
||||
.modal.nosave .modal-footer button.wait {
|
||||
display: inline-block !important;
|
||||
visibility: visible !important;
|
||||
}
|
||||
|
||||
.cke_widget_wrapper {
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
@@ -219,6 +219,13 @@ ul.oe_menu_editor
|
||||
.modal .image-preview
|
||||
margin-bottom: 0.5em
|
||||
|
||||
.modal.nosave .modal-footer
|
||||
button.save
|
||||
display: none
|
||||
button.wait
|
||||
display: inline-block !important
|
||||
visibility: visible !important
|
||||
|
||||
// wrapper positioned relatively for drag&drop widget which is disabled below.
|
||||
// Breaks completely horribly crazy products listing page, so take it out.
|
||||
.cke_widget_wrapper
|
||||
|
||||
@@ -1030,6 +1030,7 @@
|
||||
}),
|
||||
|
||||
start: function () {
|
||||
this.$('.modal-footer [disabled]').text("Uploading…");
|
||||
var $options = this.$('.image-style').children();
|
||||
this.image_styles = $options.map(function () { return this.value; }).get();
|
||||
|
||||
@@ -1065,6 +1066,7 @@
|
||||
},
|
||||
|
||||
file_selection: function () {
|
||||
this.$el.addClass('nosave');
|
||||
this.$('button.filepicker').removeClass('btn-danger btn-success');
|
||||
|
||||
var self = this;
|
||||
@@ -1087,6 +1089,7 @@
|
||||
this.set_image(url);
|
||||
},
|
||||
preview_image: function () {
|
||||
this.$el.removeClass('nosave');
|
||||
var image = this.$('input.url').val();
|
||||
if (!image) { return; }
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<div class="modal-body"><t t-raw="__content__"/></div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Discard</button>
|
||||
<button type="button" class="btn hidden wait" disabled="disabled"/>
|
||||
<button type="button" class="btn btn-primary save">Save Changes</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user