mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3817 - Audit and fix calls to deprecated jQuery method
This commit is contained in:
@@ -12,7 +12,7 @@ oWelcomePopupDialogElem.dialog({
|
||||
title: oWelcomePopupDialogElem.attr('data-title'),
|
||||
open: function () {
|
||||
// Focus on acknowledge button
|
||||
const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first');
|
||||
const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary').first();
|
||||
oAckButton.trigger('focus');
|
||||
|
||||
// Count stack items and change button label to close if there is only one
|
||||
@@ -75,13 +75,13 @@ oWelcomePopupDialogElem
|
||||
oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"][data-uuid="' + sUUIDEscapedForSelector + '"]').addClass('ibo-is-acknowledged');
|
||||
|
||||
// Display next message if any
|
||||
const oNextStackItemElem = oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged):first');
|
||||
const oNextStackItemElem = oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged)').first();
|
||||
if (oNextStackItemElem.length > 0) {
|
||||
oNextStackItemElem.trigger('click');
|
||||
|
||||
// Count non acknowledged stack items and change button label to close if there is only one
|
||||
if (oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged)').length === 1) {
|
||||
const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first');
|
||||
const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary').first();
|
||||
oAckButton.text({{ 'UI:WelcomePopup:Button:AcknowledgeAndClose'|dict_s|json_encode|raw }});
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
{% if oUIBlock.GetShowFilename() %}
|
||||
$('#{{ oUIBlock.GetId() }}').bind('change', function() {
|
||||
$('#{{ oUIBlock.GetId() }}').on('change', function() {
|
||||
var fileName = $(this).val().replace(/^.*[\\\/]/, '');
|
||||
fileName = $('<div/>').text(fileName).html();
|
||||
$('#{{ oUIBlock.GetId() }}-file-name').html(fileName);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% include "base/components/input/inputlabel.html.twig" %}
|
||||
{% endif %}
|
||||
<select id="{{ oUIBlock.GetId() }}" name="{{ oUIBlock.GetName() }}"
|
||||
{% if oUIBlock.GetSubmitOnChange() %} onChange="this.form.submit();" {% endif %}
|
||||
{% if oUIBlock.GetSubmitOnChange() %} onChange="this.form.trigger('submit');" {% endif %}
|
||||
{% if oUIBlock.IsMultiple() %} multiple {% endif %}
|
||||
class="{% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %}{% if oUIBlock.GetAdditionalCSSClassesAsString() %} {{ oUIBlock.GetAdditionalCSSClassesAsString() }}{% endif %}"
|
||||
{% if oUIBlock.GetDataAttributes() %}
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
$('#{{ oUIBlock.GetId() }}').on('edit_object', function(){
|
||||
let oFavoriteButton = $(this).find('#UIMenuModify');
|
||||
if(oFavoriteButton[0]){
|
||||
oFavoriteButton[0].click();
|
||||
oFavoriteButton[0].trigger('click');
|
||||
}
|
||||
else{
|
||||
let oPopupItemButton = $('[data-role="ibo-popover-menu"]').find('[data-resource-id="UI:Menu:Modify"]');
|
||||
if(oPopupItemButton[0]){
|
||||
oPopupItemButton[0].click();
|
||||
oPopupItemButton[0].trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -28,12 +28,12 @@
|
||||
$('#{{ oUIBlock.GetId() }}').on('delete_object', function(){
|
||||
let oFavoriteButton = $(this).find('#UIMenuDelete');
|
||||
if(oFavoriteButton[0]){
|
||||
oFavoriteButton[0].click();
|
||||
oFavoriteButton[0].trigger('click');
|
||||
}
|
||||
else{
|
||||
let oPopupItemButton = $('[data-role="ibo-popover-menu"]').find('[data-resource-id="UI:Menu:Delete"]');
|
||||
if(oPopupItemButton[0]){
|
||||
oPopupItemButton[0].click();
|
||||
oPopupItemButton[0].trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -41,22 +41,22 @@
|
||||
$('#{{ oUIBlock.GetId() }}').on('new_object', function(){
|
||||
let oFavoriteButton = $(this).find('#UIMenuNew');
|
||||
if(oFavoriteButton[0]){
|
||||
oFavoriteButton[0].click();
|
||||
oFavoriteButton[0].trigger('click');
|
||||
}
|
||||
else{
|
||||
let oPopupItemButton = $('[data-role="ibo-popover-menu"]').find('[data-resource-id="UI:Menu:New"]');
|
||||
if(oPopupItemButton[0]){
|
||||
oPopupItemButton[0].click();
|
||||
oPopupItemButton[0].trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
{% if oUIBlock.GetObjectMode() == constant('cmdbAbstractObject::ENUM_DISPLAY_MODE_EDIT') or oUIBlock.GetObjectMode() == constant('cmdbAbstractObject::ENUM_DISPLAY_MODE_CREATE') %}
|
||||
$('#{{ oUIBlock.GetId() }}').on('save_object', function(){
|
||||
$(this).find('button[type="submit"][name=""][value=""]').click();
|
||||
$(this).find('button[type="submit"][name=""][value=""]').trigger('click');
|
||||
});
|
||||
{% elseif oUIBlock.GetObjectMode() == constant('cmdbAbstractObject::ENUM_DISPLAY_MODE_STIMULUS') %}
|
||||
$('#{{ oUIBlock.GetId() }}').on('save_object', function(){
|
||||
$(this).find('button[type="submit"][name="submit"][value="submit"]').click();
|
||||
$(this).find('button[type="submit"][name="submit"][value="submit"]').trigger('click');
|
||||
});
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{# @copyright Copyright (C) 2010-2024 Combodo SAS #}
|
||||
{# @license http://opensource.org/licenses/AGPL-3.0 #}
|
||||
|
||||
$("#user").focus();
|
||||
$("#user").trigger('focus');
|
||||
Reference in New Issue
Block a user