diff options
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_renderer.js')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_renderer.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_renderer.js b/addons/web/static/src/js/views/basic/basic_renderer.js index 197892f3361..33267283a15 100644 --- a/addons/web/static/src/js/views/basic/basic_renderer.js +++ b/addons/web/static/src/js/views/basic/basic_renderer.js @@ -168,9 +168,10 @@ var BasicRenderer = AbstractRenderer.extend({ * @private * @param {Object} record * @param {integer} currentIndex - * @param {Object} [options] + * @param {Object} [options={}] * @param {integer} [options.inc=1] - the increment to use when searching for the * "next" possible one + * @param {boolean} [options.noAutomaticCreate=false] * @param {boolean} [options.wrap=false] if true, when we arrive at the end of the * list of widget, we wrap around and try to activate widgets starting at * the beginning. Otherwise, we just stop trying and return -1 @@ -184,7 +185,11 @@ var BasicRenderer = AbstractRenderer.extend({ var recordWidgets = this.allFieldWidgets[record.id] || []; for (var i = 0 ; i < recordWidgets.length ; i++) { - var activated = recordWidgets[currentIndex].activate({event: options.event}); + var activated = recordWidgets[currentIndex].activate( + { + event: options.event, + noAutomaticCreate: options.noAutomaticCreate || false + }); if (activated) { return currentIndex; } @@ -213,11 +218,12 @@ var BasicRenderer = AbstractRenderer.extend({ * @private * @param {Object} record * @param {integer} currentIndex + * @param {Object|undefined} options * @return {integer} */ - _activateNextFieldWidget: function (record, currentIndex) { + _activateNextFieldWidget: function (record, currentIndex, options) { currentIndex = (currentIndex + 1) % (this.allFieldWidgets[record.id] || []).length; - return this._activateFieldWidget(record, currentIndex, {inc: 1}); + return this._activateFieldWidget(record, currentIndex, _.extend({inc: 1}, options)); }, /** * This is a wrapper of the {@see _activateFieldWidget} function to select |
