diff options
| author | jbm-odoo <jbm@odoo.com> | 2020-02-20 08:05:40 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2020-03-11 09:57:55 +0000 |
| commit | c4c2430807cba6f99af54f880bf0128440e8fa75 (patch) | |
| tree | 934fba9bdae4e0db14e9ad7a8eecbc75c76911c9 /addons/web/static/src/js/widgets | |
| parent | ff53bdfb0986023422269f0d649ad0c015054d99 (diff) | |
[IMP] sign: Add color option for signature
Blue by default
taskID: 2196770
Diffstat (limited to 'addons/web/static/src/js/widgets')
| -rw-r--r-- | addons/web/static/src/js/widgets/name_and_signature.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/static/src/js/widgets/name_and_signature.js b/addons/web/static/src/js/widgets/name_and_signature.js index aa30b2c0521..5a20ea4fa22 100644 --- a/addons/web/static/src/js/widgets/name_and_signature.js +++ b/addons/web/static/src/js/widgets/name_and_signature.js @@ -48,6 +48,8 @@ var NameAndSignature = Widget.extend({ * the signer. * @param {string} [options.defaultFont=''] - The unique and default * font for auto mode. If empty, all fonts are visible. + * * @param {string} [options.fontColor='DarkBlue'] - Color of signature + * (must be a string color) * @param {string} [options.noInputName=false] - If set to true, * the user can not enter his name. If there aren't defaultName, * auto mode is hidden. @@ -67,6 +69,7 @@ var NameAndSignature = Widget.extend({ this.htmlId = _.uniqueId(); this.defaultName = options.defaultName || ''; this.defaultFont = options.defaultFont || ''; + this.fontColor = options.fontColor || 'DarkBlue'; this.displaySignatureRatio = options.displaySignatureRatio || 3.0; this.signatureType = options.signatureType || 'signature'; this.signMode = options.mode || 'draw'; @@ -248,12 +251,11 @@ var NameAndSignature = Widget.extend({ .jSignature({ 'decor-color': '#D1D0CE', 'background-color': '#FFF', - 'color': '#000', + 'color': this.fontColor, 'lineWidth': 2, 'width': width, 'height': height, }); - this.emptySignature = this.$signatureField.jSignature('getData'); this.setMode(this.signMode, true); @@ -373,6 +375,7 @@ var NameAndSignature = Widget.extend({ font: font, text: text, type: this.signatureType, + color: this.fontColor, })); $svg.attr({ 'xmlns': "http://www.w3.org/2000/svg", |
