summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-11-06 16:24:12 +0100
committerXavier Morel <xmo@openerp.com>2013-11-06 16:24:12 +0100
commit20899155c5881f2ca1a576b01fb68da876e6e2a9 (patch)
treebb1ca7a64fe4ac6facaddd2cc88d07e2a0af8c67 /addons/website/static/src
parent21ffca33c524ce063f958a29343eb10b46e4a32b (diff)
[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
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/css/editor.css9
-rw-r--r--addons/website/static/src/css/editor.sass7
-rw-r--r--addons/website/static/src/js/website.editor.js3
-rw-r--r--addons/website/static/src/xml/website.editor.xml1
4 files changed, 19 insertions, 1 deletions
diff --git a/addons/website/static/src/css/editor.css b/addons/website/static/src/css/editor.css
index 54276e715c4..ea4d38a9e67 100644
--- a/addons/website/static/src/css/editor.css
+++ b/addons/website/static/src/css/editor.css
@@ -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;
}
diff --git a/addons/website/static/src/css/editor.sass b/addons/website/static/src/css/editor.sass
index 7ec41b2e760..f7ca4dc8cd2 100644
--- a/addons/website/static/src/css/editor.sass
+++ b/addons/website/static/src/css/editor.sass
@@ -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
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 734d4b0606d..b23ccf7a9f0 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -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; }
diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml
index fd89e70d2e1..66b82ae7cbe 100644
--- a/addons/website/static/src/xml/website.editor.xml
+++ b/addons/website/static/src/xml/website.editor.xml
@@ -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>