mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2039 - Improve title / message for set input with a minimum item constraint
This commit is contained in:
@@ -6,6 +6,7 @@ Selectize.define("combodo_min_items", function (aOptions) {
|
||||
// Plugin options
|
||||
aOptions = $.extend({
|
||||
minItems: 0,
|
||||
errorTitle: 'This change is not allowed',
|
||||
errorMessage: 'Minimum ' + aOptions.minItems + ' item(s) required.'
|
||||
},
|
||||
aOptions
|
||||
@@ -16,7 +17,9 @@ Selectize.define("combodo_min_items", function (aOptions) {
|
||||
let oOriginal = oSelf.removeItem;
|
||||
return function () {
|
||||
if(oSelf.items.length <= aOptions.minItems) {
|
||||
CombodoModal.OpenErrorModal(aOptions.errorMessage, []);
|
||||
CombodoModal.OpenErrorModal(aOptions.errorMessage, {
|
||||
title: aOptions.errorTitle
|
||||
});
|
||||
return;
|
||||
}
|
||||
return oOriginal.apply(this, arguments);
|
||||
|
||||
Reference in New Issue
Block a user