From 69076b64e5f659927ad72c8b4f0161f6701d425e Mon Sep 17 00:00:00 2001 From: "Dimitrios T. Tanis" Date: Mon, 13 Sep 2021 14:03:00 +0300 Subject: [PATCH] [FIX]web_widget_digitized_signature:Respect custom width-height set for widget, add border Although widget allowed to set size in view (width, height) it was hardcoded to 550x150. Allow setting width and height for widget and fallback to previous default of 550x150 Set border on signature widget to explicitly show widget limits --- .../static/src/js/digital_sign.js | 16 ++++++++-------- .../views/web_digital_sign_view.xml | 5 +++++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/web_widget_digitized_signature/static/src/js/digital_sign.js b/web_widget_digitized_signature/static/src/js/digital_sign.js index 6df41d87b1f1..0256acf2d693 100644 --- a/web_widget_digitized_signature/static/src/js/digital_sign.js +++ b/web_widget_digitized_signature/static/src/js/digital_sign.js @@ -26,8 +26,8 @@ odoo.define('web_widget_digitized_signature.web_digital_sign', function(require) 'decor-color': '#D1D0CE', 'color': '#000', 'background-color': '#fff', - 'height': '150', - 'width': '550' + 'height': this.attrs['height'] || '150', + 'width': this.attrs['width'] || '550' }; this.empty_sign = []; }, @@ -49,8 +49,8 @@ odoo.define('web_widget_digitized_signature.web_digital_sign', function(require) 'decor-color': '#D1D0CE', 'color': '#000', 'background-color': '#fff', - 'height': '150', - 'width': '550', + 'height': this.attrs['height'] || '150', + 'width': this.attrs['width'] || '550', 'clear': true }; this.$(".signature").jSignature(sign_options); @@ -120,8 +120,8 @@ odoo.define('web_widget_digitized_signature.web_digital_sign', function(require) 'decor-color': '#D1D0CE', 'color': '#000', 'background-color': '#fff', - 'height': '150', - 'width': '550' + 'height': this.attrs['height'] || '150', + 'width': this.attrs['width'] || '550' }; this.$(".signature").jSignature("init", sign_options); } @@ -133,8 +133,8 @@ odoo.define('web_widget_digitized_signature.web_digital_sign', function(require) 'decor-color': '#D1D0CE', 'color': '#000', 'background-color': '#fff', - 'height': '150', - 'width': '550' + 'height': this.attrs['height'] || '150', + 'width': this.attrs['width'] || '550' }); } } diff --git a/web_widget_digitized_signature/views/web_digital_sign_view.xml b/web_widget_digitized_signature/views/web_digital_sign_view.xml index be4e8b8ce179..9728ee0e1dc7 100644 --- a/web_widget_digitized_signature/views/web_digital_sign_view.xml +++ b/web_widget_digitized_signature/views/web_digital_sign_view.xml @@ -4,6 +4,11 @@