mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
* Add corresponding buttons depending on old edit mode (need to check with piR pour récuperer l'ancienne valeur. * N°5904 - Handle attribute linked set edit_mode * N°5904 Move calls to private jquery widget methods to public * N°5904 - Worker improvements add button on link tagset * Change itop set widget to new set block UI (5) * Change itop set widget to new set block UI (5) * Renommage variables JS avec le prefix combodo * Search dialog block id conflict with form id * add moved js files in iTopWebPage compatibility list --------- Co-authored-by: Stephen Abello <stephen.abello@combodo.com>
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
let CombodoLinkSet = new function () {
|
|
|
|
/**
|
|
* Create a new link object and add it to set widget.
|
|
*
|
|
* @param sLinkedClass
|
|
* @param sCode
|
|
* @param sHostObjectClass
|
|
* @param sHostObjectKey
|
|
* @param sRemoteExtKey
|
|
* @param sRemoteClass
|
|
* @param oWidget
|
|
* @constructor
|
|
*/
|
|
const CallCreateLinkedObject = function(sLinkedClass, sCode, sHostObjectClass, sHostObjectKey, sRemoteExtKey, sRemoteClass, oWidget)
|
|
{
|
|
// Create link object
|
|
CombodoLinkSetWorker.CreateLinkedObject(sLinkedClass, sCode, sHostObjectClass, sHostObjectKey,
|
|
function(){
|
|
$(this).find("form").remove();
|
|
$(this).dialog('destroy');
|
|
},
|
|
function(event, data){
|
|
|
|
// We have just create a link object, now request the remote object
|
|
CombodoLinkSetWorker.GetRemoteObject(data.data.object.class_name, data.data.object.key, sRemoteExtKey, sRemoteClass, function(data){
|
|
|
|
// Add the new remote object in widget set options list
|
|
const selectize = oWidget[0].selectize;
|
|
selectize.addOption(data.data.object);
|
|
selectize.refreshOptions(false);
|
|
|
|
// Select the new remote object
|
|
selectize.addItem(data.data.object.key);
|
|
|
|
// Add to initial values, to handle remove action
|
|
selectize.addInitialValue(data.data.object.key);
|
|
});
|
|
});
|
|
}
|
|
|
|
|
|
return {
|
|
CreateLinkedObject: CallCreateLinkedObject,
|
|
}
|
|
}; |