diff options
| author | Parth N. Patel <parth.pnp@gmail.com> | 2017-06-01 12:52:51 +0530 |
|---|---|---|
| committer | ged-odoo <ged@odoo.com> | 2017-06-01 09:22:51 +0200 |
| commit | 97ecc4bc93b7a79ded10bb2ab1d2e25242997af0 (patch) | |
| tree | 7eb88550da697138c6b6c37894e63d8fb40dff5b /addons/web/static/src | |
| parent | f0a6bb6ce358b76b428a6b60d264c7221ee5bdaf (diff) | |
[IMP] web: kanban: do not remove quick create if dirty
In this commit, we improve the behaviour of quick creation in grouped kanban views. The issue was that the quick create widget was removed when the user click somewhere else, even if the user added some text. For example, the problem could be seen in the kanban view for the tasks.
In this commit, we simply keep it around if there is a non empty text.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/kanban/kanban_column.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/addons/web/static/src/js/views/kanban/kanban_column.js b/addons/web/static/src/js/views/kanban/kanban_column.js index e17b77aa44f..80d48a78774 100644 --- a/addons/web/static/src/js/views/kanban/kanban_column.js +++ b/addons/web/static/src/js/views/kanban/kanban_column.js @@ -141,14 +141,12 @@ var KanbanColumn = Widget.extend({ return; } var self = this; - this.quickCreateWidget = new RecordQuickCreate(this, { - width: this.records.length ? this.records[0].$el.innerWidth() : this.$el.width() - 8, - defaultName: this.data.getContext().default_name, - }); + var width = this.records.length ? this.records[0].$el.innerWidth() : this.$el.width() - 8; + this.quickCreateWidget = new RecordQuickCreate(this, width); this.quickCreateWidget.insertAfter(this.$header); this.quickCreateWidget.$el.focusout(function () { - var hasFocus = (self.quickCreateWidget.$(':focus').length > 0); - if (! hasFocus && self.quickCreateWidget) { + var taskName = self.quickCreateWidget.$('[type=text]')[0].value; + if (!taskName && self.quickCreateWidget) { self._cancelQuickCreate(); } }); |
