mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[ADD] web_widget_char_size
This commit is contained in:
committed by
Thanakrit Pintana
parent
222bec5c5d
commit
204137ad32
16
web_widget_char_size/static/src/js/char_widget.js
Normal file
16
web_widget_char_size/static/src/js/char_widget.js
Normal file
@@ -0,0 +1,16 @@
|
||||
odoo.define("web_widget_char_size.char_widget", function (require) {
|
||||
"use strict";
|
||||
|
||||
var BasicFields = require("web.basic_fields");
|
||||
|
||||
BasicFields.FieldChar.include({
|
||||
_renderEdit: function () {
|
||||
var def = this._super.apply(this, arguments);
|
||||
var option_size = this.nodeOptions.size;
|
||||
if (option_size && option_size > 0) {
|
||||
this.$el.attr("maxlength", option_size);
|
||||
}
|
||||
return def;
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user