mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 22:48:45 +02:00
N°4478 Fix linkedset widget in portal when adding new items with already selected ones
Was already committed to develop with e59d472c
This commit is contained in:
@@ -363,7 +363,7 @@ JS
|
||||
oData.items[i].target_id = oData.items[i].id;
|
||||
|
||||
// Adding item to table only if it's not already there
|
||||
if($('#{$sTableId} tr[role="row"] > td input[data-target-object-id="' + oData.items[i].target_id + '"], #{$sTableId} tr[role="row"] > td input[data-target-object-id="' + (oData.items[i].target_id*-1) + '"]').length === 0)
|
||||
if($('#{$sTableId} tr[id] > td input[data-target-object-id="' + oData.items[i].target_id + '"], #{$sTableId} tr[id] > td input[data-target-object-id="' + (oData.items[i].target_id*-1) + '"]').length === 0)
|
||||
{
|
||||
// Making id negative in order to recognize it when persisting
|
||||
oData.items[i].id = -1 * parseInt(oData.items[i].id);
|
||||
@@ -457,7 +457,7 @@ EOF
|
||||
// Checking removed objects
|
||||
for(var i in oValues.current)
|
||||
{
|
||||
if($('#{$sTableId} tr[role="row"] input[data-object-id="'+i+'"]').length === 0)
|
||||
if($('#{$sTableId} tr[id="'+i+'"]').length === 0)
|
||||
{
|
||||
oValues.remove[i] = {};
|
||||
}
|
||||
@@ -492,7 +492,7 @@ EOF
|
||||
$('#{$sButtonAddId}').off('click').on('click', function(){
|
||||
// Preparing current values
|
||||
var aObjectIdsToIgnore = [];
|
||||
$('#{$sTableId} tr[role="row"] > td input[data-target-object-id]').each(function(iIndex, oElem){
|
||||
$('#{$sTableId} tr[id] > td input[data-target-object-id]').each(function(iIndex, oElem){
|
||||
aObjectIdsToIgnore.push( $(oElem).attr('data-target-object-id') );
|
||||
});
|
||||
// Creating a new modal
|
||||
|
||||
Reference in New Issue
Block a user