mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7157 - Allow users to unsubscribe from notification channels (#611)
* N°7157 - Allow users to unsubscribe from notification channels * Fix type hinting * Add missing dict entries * Allows to subscribe/unsubscribe from notifications individually * Refactor NotificationsService to singleton pattern * Refactor NotificationsRepository to singleton pattern and rename methods to a more functional naming * Add PHPDoc and type hints * Dump autoloaders * Replace modals with toasts * Add dict entry --------- Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
This commit is contained in:
26
js/selectize/plugin_combodo_min_items.js
Normal file
26
js/selectize/plugin_combodo_min_items.js
Normal file
@@ -0,0 +1,26 @@
|
||||
Selectize.define("combodo_min_items", function (aOptions) {
|
||||
|
||||
// Selectize instance
|
||||
let oSelf = this;
|
||||
|
||||
// Plugin options
|
||||
aOptions = $.extend({
|
||||
minItems: 0,
|
||||
errorMessage: 'Minimum ' + aOptions.minItems + ' item(s) required.'
|
||||
},
|
||||
aOptions
|
||||
);
|
||||
|
||||
// Override removeItem function
|
||||
oSelf.removeItem = (function () {
|
||||
let oOriginal = oSelf.removeItem;
|
||||
return function () {
|
||||
if(oSelf.items.length <= aOptions.minItems) {
|
||||
CombodoModal.OpenErrorModal(aOptions.errorMessage, []);
|
||||
return;
|
||||
}
|
||||
return oOriginal.apply(this, arguments);
|
||||
}
|
||||
})();
|
||||
|
||||
});
|
||||
@@ -57,7 +57,8 @@ Selectize.define("combodo_update_operations", function (aOptions) {
|
||||
let oOriginal = oSelf.disable;
|
||||
return function () {
|
||||
oOriginal.apply(oSelf, arguments);
|
||||
oSelf.$operationsInput.prop('disabled', true);
|
||||
if(oSelf.$operationsInput !== undefined)
|
||||
oSelf.$operationsInput.prop('disabled', true);
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user