[REF] web: move misplaced kanban quick create code
This commit is contained in:
@@ -144,16 +144,9 @@ var KanbanColumn = Widget.extend({
|
||||
if (this.quickCreateWidget) {
|
||||
return;
|
||||
}
|
||||
var self = this;
|
||||
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 taskName = self.quickCreateWidget.$('[type=text]')[0].value;
|
||||
if (!taskName && self.quickCreateWidget) {
|
||||
self._cancelQuickCreate();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Adds a record in the column.
|
||||
|
||||
@@ -16,6 +16,7 @@ var AbstractQuickCreate = Widget.extend({
|
||||
'keypress input': '_onKeypress',
|
||||
'mousedown .o_kanban_add': '_onMousedown',
|
||||
'mousedown .o_kanban_cancel': '_onMousedown',
|
||||
'focusout': '_onFocusOut',
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -74,6 +75,17 @@ var AbstractQuickCreate = Widget.extend({
|
||||
_onCancelClicked: function () {
|
||||
this._cancel();
|
||||
},
|
||||
/**
|
||||
* Cancels quick creation on focusout input event
|
||||
*
|
||||
* @private
|
||||
* @param {KeyEvent} ev
|
||||
*/
|
||||
_onFocusOut: function (ev) {
|
||||
if (!this.$input.val()) {
|
||||
this._cancel();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Cancels quick creation on escape keydown event
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user