eLBati 9 years ago
parent
commit
e2bb37fe8f
  1. 18
      web_widget_digital_signature/static/src/js/digital_sign.js

18
web_widget_digital_signature/static/src/js/digital_sign.js

@ -39,26 +39,20 @@ openerp.web_widget_digital_signature = function(instance) {
}
var $img = $(QWeb.render("FieldBinaryImage-img", { widget: this, url: url }));
this.$el.find('img').remove();
var sign_options = {}
var sign_options = {};
if ('width' in self.node.attrs){
sign_options.width = self.node.attrs.width;
}
if ('height' in self.node.attrs){
sign_options.height = self.node.attrs.height;
}
if(this.view.get("actual_mode") !== 'edit' && this.view.get("actual_mode") !== 'create'){
this.$el.prepend($img);
}else if(this.view.get("actual_mode") == 'edit' ){
this.$el.find('> img').remove();
this.$el.find('> canvas').remove();
if(! this.get('value')){
this.$el.find('> img').remove();
$(this.$el[0]).find(".signature").signature(sign_options);
}else if(this.get('value')){
var actual_mode = this.view.get("actual_mode");
if(actual_mode !== 'edit' && actual_mode !== 'create'){
this.$el.prepend($img);
}else if(actual_mode == 'edit' || actual_mode == 'create'){
if( actual_mode == 'create'){
images = {};
}
}else if( this.view.get("actual_mode") == 'create'){
images = {}
this.$el.find('> img').remove();
this.$el.find('> canvas').remove();
if(! this.get('value')){

Loading…
Cancel
Save