mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
52 lines
1.6 KiB
Twig
52 lines
1.6 KiB
Twig
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
|
|
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
|
{% apply spaceless %}
|
|
|
|
var selectionCount{{ oUIBlock.sIdShortcuts }} = $('#{{ oUIBlock.sIdShortcuts }} [name="selectionCount"]');
|
|
selectionCount{{ oUIBlock.sIdShortcuts }}.on('change',function()
|
|
{
|
|
let iCountSelected = selectionCount{{ oUIBlock.sIdShortcuts }}.val();
|
|
if (iCountSelected == 0)
|
|
{
|
|
$('#shortcut_btn_rename').prop('disabled', true);
|
|
$('#shortcut_btn_delete').prop('disabled', true);
|
|
}
|
|
else if (iCountSelected == 1)
|
|
{
|
|
$('#shortcut_btn_rename').prop('disabled', false);
|
|
$('#shortcut_btn_delete').prop('disabled', false);
|
|
}
|
|
else
|
|
{
|
|
$('#shortcut_btn_rename').prop('disabled', true);
|
|
$('#shortcut_btn_delete').prop('disabled', false);
|
|
}
|
|
}
|
|
);
|
|
|
|
$('#shortcut_btn_rename').prop('disabled', true);
|
|
$('#shortcut_btn_delete').prop('disabled', true);
|
|
|
|
$('#shortcut_btn_rename').on('click', function() {
|
|
var oParams = getMultipleSelectionParams('{{ oUIBlock.sIdShortcuts }}')
|
|
oParams.operation = 'shortcut_rename_dlg';
|
|
|
|
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', oParams, function(data){
|
|
$('body').append(data);
|
|
});
|
|
return false;
|
|
});
|
|
$('#shortcut_btn_delete').on('click', function() {
|
|
if (confirm('{{'UI:ShortcutDelete:Confirm' |dict_s }}'))
|
|
{
|
|
var oParams = getMultipleSelectionParams('{{ oUIBlock.sIdShortcuts }}')
|
|
oParams.operation = 'shortcut_delete_go';
|
|
|
|
$.post(GetAbsoluteUrlAppRoot()+'pages/ajax.render.php', oParams, function(data){
|
|
$('body').append(data);
|
|
});
|
|
}
|
|
return false;
|
|
});
|
|
|
|
{% endapply %} |