[IMP] Refactor binary field classes name

bzr revid: fme@openerp.com-20110519111237-23oour5fjxxvh2c3
This commit is contained in:
Fabien Meghazi 2011-05-19 13:12:37 +02:00
parent 665e779b78
commit 5da65e1517
3 changed files with 11 additions and 11 deletions

View File

@ -624,7 +624,7 @@ body.openerp {
/* http://www.quirksmode.org/dom/inputfile.html
* http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image
*/
.openerp button.oe-binary-image-set {
.openerp button.oe-binary-file-set {
overflow: hidden;
position: relative;
}

View File

@ -1196,7 +1196,7 @@ openerp.base.form.FieldImage = openerp.base.form.Field.extend({
start: function() {
this._super.apply(this, arguments);
this.$element.find('input.oe-binary-file').change(this.on_file_change);
this.$element.find('button.oe-binary-image-clear').click(this.on_clear);
this.$element.find('button.oe-binary-file-clear').click(this.on_clear);
},
set_value_from_ui: function() {
},
@ -1211,10 +1211,10 @@ openerp.base.form.FieldImage = openerp.base.form.Field.extend({
window[this.iframe] = this.on_file_uploaded;
this.$element.find('form.oe-binary-form input[name=session_id]').val(this.session.session_id);
this.$element.find('form.oe-binary-form').submit();
this.toggle_throbber();
this.toggle_progress();
},
toggle_throbber: function() {
this.$element.find('div.oe-binary-progress, div.oe-binary-image-buttons').toggle();
toggle_progress: function() {
this.$element.find('div.oe-binary-progress, div.oe-binary').toggle();
},
on_file_uploaded: function(size, name, content_type, img) {
delete(window[this.iframe]);
@ -1227,7 +1227,7 @@ openerp.base.form.FieldImage = openerp.base.form.Field.extend({
this.$element.find('img.oe-binary-image').attr('src', 'data:' + (content_type || 'image/png') + ';base64,' + img);
this.on_ui_change();
}
this.toggle_throbber();
this.toggle_progress();
},
on_clear: function() {
if (this.value !== false) {

View File

@ -401,9 +401,9 @@
</tr>
<tr>
<td align="center" valign="bottom" height="25">
<div class="oe-binary-image-buttons">
<div class="oe-binary">
<!-- TODO: input@type=file inside a button won't work in firefox. Use links instead -->
<button class="button oe-binary-image-set" type="button" title="Set Image">
<button class="button oe-binary-file-set" type="button" title="Set Image">
<img src="/base/static/src/img/icons/STOCK_DIRECTORY.png"/>
<form class="oe-binary-form" t-att-target="widget.iframe"
method="post" enctype="multipart/form-data" action="/base/formview/upload">
@ -412,10 +412,10 @@
<input type="file" class="oe-binary-file" name="ufile"/>
</form>
</button>
<!--<button class="button oe-binary-image-save" type="button" title="Save As">
<button class="button oe-binary-file-save" type="button" title="Save As">
<img src="/base/static/src/img/icons/gtk-save.png"/>
</button>-->
<button class="button oe-binary-image-clear" type="button" title="Clear">
</button>
<button class="button oe-binary-file-clear" type="button" title="Clear">
<img src="/base/static/src/img/icons/STOCK_MISSING_IMAGE.png"/>
</button>
</div>