Skip to content

Commit

Permalink
[FIX]web_widget_digitized_signature:Respect custom width-height set f…
Browse files Browse the repository at this point in the history
…or 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
  • Loading branch information
diggy128 committed Sep 13, 2021
1 parent 5368e7a commit 69076b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
16 changes: 8 additions & 8 deletions web_widget_digitized_signature/static/src/js/digital_sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
},
Expand All @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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'
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<xpath expr="." position="inside">
<script type="text/javascript"
src="/web_widget_digitized_signature/static/src/js/digital_sign.js"/>
<style type="text/css">
.jSignature {
border: 2px dotted gray !important;
}
</style>
</xpath>
</template>

Expand Down

0 comments on commit 69076b6

Please sign in to comment.