mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6651 - 3.1 bulk modify n:n like Tagset: checkbox ignored (#552)
- handle selectize enable/disable to update operation hidden input state - don't execute elements click callback when input disabled - merge current and initial values for the initial value
This commit is contained in:
committed by
Benjamin Dalsass
parent
d2fc87c6f9
commit
74004fa375
@@ -154,6 +154,11 @@ Selectize.define("combodo_multi_values_synthesis", function (aOptions) {
|
||||
// Listen item element click event
|
||||
$item.on('click', function(){
|
||||
|
||||
// input disabled
|
||||
if(oSelf.$input.is(':disabled')){
|
||||
return;
|
||||
}
|
||||
|
||||
// If element has operation
|
||||
if(aOperations[sItem] === OPERATIONS.add || aOperations[sItem] === OPERATIONS.remove) {
|
||||
|
||||
|
||||
@@ -43,6 +43,24 @@ Selectize.define("combodo_update_operations", function (aOptions) {
|
||||
};
|
||||
})();
|
||||
|
||||
// Override enable function
|
||||
oSelf.enable = (function () {
|
||||
let oOriginal = oSelf.enable;
|
||||
return function () {
|
||||
oOriginal.apply(oSelf, arguments);
|
||||
oSelf.$operationsInput.prop('disabled', false);
|
||||
}
|
||||
})();
|
||||
|
||||
// Override disable function
|
||||
oSelf.disable = (function () {
|
||||
let oOriginal = oSelf.disable;
|
||||
return function () {
|
||||
oOriginal.apply(oSelf, arguments);
|
||||
oSelf.$operationsInput.prop('disabled', true);
|
||||
}
|
||||
})();
|
||||
|
||||
// Override addItem function
|
||||
oSelf.addItem = (function () {
|
||||
let oOriginal = oSelf.addItem;
|
||||
|
||||
@@ -81,7 +81,7 @@ class LinkSetUIBlockFactory extends SetUIBlockFactory
|
||||
$oSetUIBlock->GetDataProvider()->SetOptions(array_values($aInitialOptions));
|
||||
// Set value
|
||||
$oSetUIBlock->SetValue(json_encode($aCurrentValues));
|
||||
$oSetUIBlock->SetInitialValue(json_encode($aInitialValues));
|
||||
$oSetUIBlock->SetInitialValue(json_encode(array_merge($aInitialValues, $aCurrentValues)));
|
||||
} else {
|
||||
$oSetUIBlock->SetHasError(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user