mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
N°3923 Fix up, down, enter key usage in ext key widget
This commit is contained in:
@@ -22,7 +22,7 @@ Selectize.define('custom_itop', function(aOptions) {
|
|||||||
var iIndex;
|
var iIndex;
|
||||||
switch (e.keyCode) {
|
switch (e.keyCode) {
|
||||||
case KEY_BACKSPACE:
|
case KEY_BACKSPACE:
|
||||||
if (e.keyCode === KEY_BACKSPACE && this.$control_input.val() === '' && !this.$activeItems.length) {
|
if (this.$control_input.val() === '' && !this.$activeItems.length) {
|
||||||
iIndex = this.caretPos-1;
|
iIndex = this.caretPos-1;
|
||||||
if (iIndex >= 0 && iIndex < this.items.length) {
|
if (iIndex >= 0 && iIndex < this.items.length) {
|
||||||
this.clear(true);
|
this.clear(true);
|
||||||
@@ -33,14 +33,14 @@ Selectize.define('custom_itop', function(aOptions) {
|
|||||||
case KEY_RETURN:
|
case KEY_RETURN:
|
||||||
if (self.isOpen) {
|
if (self.isOpen) {
|
||||||
//case nothing selected ->delete selection
|
//case nothing selected ->delete selection
|
||||||
if (!self.$activeOption || self.currentResults.query == "") {
|
if (!self.$activeOption || (self.currentResults.query === '' && !this.$control_input.val() === '')) {
|
||||||
self.deleteSelection(e);
|
self.deleteSelection(e);
|
||||||
self.setValue("");
|
self.setValue("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return original.apply();
|
return original.apply(this, arguments);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
@@ -91,7 +91,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
|
|||||||
if (item.additional_field != undefined) {
|
if (item.additional_field != undefined) {
|
||||||
val = val+'<br><i>'+item.additional_field+'</i>';
|
val = val+'<br><i>'+item.additional_field+'</i>';
|
||||||
}
|
}
|
||||||
return $("<div>").append(val);
|
return $("<div class=\"option\">").append(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
valueField: 'value',
|
valueField: 'value',
|
||||||
|
|||||||
Reference in New Issue
Block a user