[imp] refactored field image
bzr revid: nicolas.vanhoren@openerp.com-20120319154744-o3k73ugs3s48p8fg
This commit is contained in:
@@ -3365,6 +3365,9 @@ openerp.web.form.FieldBinary = openerp.web.form.AbstractField.extend({
|
||||
|
||||
openerp.web.form.FieldBinaryFile = openerp.web.form.FieldBinary.extend({
|
||||
template: 'FieldBinaryFile',
|
||||
start: function() {
|
||||
this._super();
|
||||
},
|
||||
update_dom: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$element.find('.oe-binary-file-set, .oe-binary-file-clear').toggle(!this.readonly);
|
||||
@@ -3406,10 +3409,14 @@ openerp.web.form.FieldBinaryImage = openerp.web.form.FieldBinary.extend({
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$image = this.$element.find('img.oe-binary-image');
|
||||
},
|
||||
update_dom: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$element.find('.oe-binary').toggle(!this.readonly);
|
||||
var check_visibility = function() {
|
||||
if (!this.get("effective_readonly"))
|
||||
this.$element.find('.oe-binary').show();
|
||||
else
|
||||
this.$element.find('.oe-binary').hide();
|
||||
}
|
||||
this.on("change:effective_readonly", this, check_visibility);
|
||||
_.bind(check_visibility, this)();
|
||||
},
|
||||
set_value: function(value) {
|
||||
this._super.apply(this, arguments);
|
||||
|
||||
@@ -68,12 +68,6 @@ openerp.web.page = function (openerp) {
|
||||
/** @namespace */
|
||||
openerp.web.page = {};
|
||||
|
||||
openerp.web.page.FieldBinaryImageReaonly = openerp.web.form.FieldBinaryImage.extend({
|
||||
update_dom: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$element.find('.oe-binary').hide();
|
||||
}
|
||||
});
|
||||
openerp.web.page.FieldBinaryFileReadonly = openerp.web.form.FieldBinary.extend({
|
||||
form_template: 'FieldURI.readonly',
|
||||
start: function() {
|
||||
@@ -97,7 +91,6 @@ openerp.web.page = function (openerp) {
|
||||
});
|
||||
openerp.web.page.readonly = openerp.web.form.widgets.extend({
|
||||
'binary': 'openerp.web.page.FieldBinaryFileReadonly',
|
||||
'image': 'openerp.web.page.FieldBinaryImageReaonly',
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user