mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°7355 - Fix deprecated jQuery call
This commit is contained in:
@@ -480,7 +480,7 @@ abstract class Dashboard
|
||||
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
|
||||
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
|
||||
|
||||
$('#attr_auto_reload').change( function(ev) {
|
||||
$('#attr_auto_reload').on('change', function(ev) {
|
||||
$("#attr_auto_reload_sec").prop('disabled', !$(this).is(':checked'));
|
||||
} );
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ $("#attr_auto_reload_sec").attr('data-tooltip-content', '$sRateTitle');
|
||||
CombodoTooltip.InitTooltipFromMarkup($("#attr_auto_reload_sec"));
|
||||
$("#attr_auto_reload_sec").prop('disabled', !$('#attr_auto_reload').is(':checked'));
|
||||
|
||||
$('#attr_auto_reload').change( function(ev) {
|
||||
$('#attr_auto_reload').on('change', function(ev) {
|
||||
$("#attr_auto_reload_sec").prop('disabled', !$(this).is(':checked'));
|
||||
} );
|
||||
|
||||
|
||||
@@ -734,7 +734,7 @@ HTML
|
||||
],
|
||||
});
|
||||
$('#fs_{$this->iId}').on('submit.uiAutocomplete', oACWidget_{$this->iId}.DoSearchObjects);
|
||||
$('#dc_{$this->iId}').resize(oACWidget_{$this->iId}.UpdateSizes);
|
||||
$('#dc_{$this->iId}').on('resize', oACWidget_{$this->iId}.UpdateSizes);
|
||||
JS
|
||||
);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ HTML
|
||||
});
|
||||
$('#dlg_{$this->m_iInputId}').dialog('option', {title:'$sTitle'});
|
||||
$('#SearchFormToAdd_{$this->m_iInputId} form').on('submit.uilinksWizard', oForeignKeysWidget{$this->m_iInputId}.SearchObjectsToAdd);
|
||||
$('#SearchFormToAdd_{$this->m_iInputId}').resize(oForeignKeysWidget{$this->m_iInputId}.UpdateSizes);
|
||||
$('#SearchFormToAdd_{$this->m_iInputId}').on('resize', oForeignKeysWidget{$this->m_iInputId}.UpdateSizes);
|
||||
JS
|
||||
);
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ abstract class AbstractAttachmentsRenderer
|
||||
e.stopPropagation();
|
||||
})
|
||||
|
||||
$(document).bind('dragover', function (e) {
|
||||
$(document).on('dragover', function (e) {
|
||||
var bFiles = false;
|
||||
if (e.dataTransfer && e.dataTransfer.types)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ abstract class AbstractAttachmentsRenderer
|
||||
window.dropZoneCnt++;
|
||||
});
|
||||
|
||||
$(document).bind('dragend dragleave drop', function(event){
|
||||
$(document).on('dragend dragleave drop', function(event){
|
||||
window.dropZoneCnt--;
|
||||
if(window.dropZone && window.dropZoneCnt === 0){
|
||||
window.dropZone.removeClass('ibo-drag-in');
|
||||
|
||||
@@ -291,7 +291,7 @@ $(function()
|
||||
},
|
||||
// Dirty means: at least one change has not been committed yet
|
||||
is_dirty: function () {
|
||||
if ($('#dashboard_editor .ui-layout-east .itop-property-field-modified').size() > 0) {
|
||||
if ($('#dashboard_editor .ui-layout-east .itop-property-field-modified').length > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -20,7 +20,7 @@ $(function()
|
||||
|
||||
this.element
|
||||
.addClass('itop-dashlet')
|
||||
.bind('click.itop-dashlet', function(event) { me._on_click(event); } );
|
||||
.on('click.itop-dashlet', function(event) { me._on_click(event); } );
|
||||
|
||||
this._update();
|
||||
},
|
||||
|
||||
@@ -433,7 +433,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
|
||||
me.UpdateSizes();
|
||||
me.UpdateButtons();
|
||||
me.ajax_request = null;
|
||||
$('#count_'+me.id+'_results').change(function () {
|
||||
$('#count_'+me.id+'_results').on('change', function () {
|
||||
me.UpdateButtons();
|
||||
});
|
||||
if (me.bDoSearch) {
|
||||
|
||||
@@ -53,7 +53,7 @@ $(function()
|
||||
});
|
||||
this.element.after(this.oButton);
|
||||
this.element.addClass( "itop-icon-select" ).button();
|
||||
this.element.bind( "reverted.itop-icon-select", function(ev, data) {
|
||||
this.element.on( "reverted.itop-icon-select", function(ev, data) {
|
||||
var idx = me._find_item(data.previous_value);
|
||||
if (idx != null)
|
||||
{
|
||||
@@ -68,7 +68,7 @@ $(function()
|
||||
this.oButton.after(this.oUploadBtn);
|
||||
}
|
||||
var id = this.element.attr('id');
|
||||
$('#event_bus').bind('tabshow.itop-icon-select'+id, function(event) {
|
||||
$('#event_bus').on('tabshow.itop-icon-select'+id, function(event) {
|
||||
// Compute the offsetX the first time the 'element' becomes visible...
|
||||
var bVisible = me.element.parent().is(':visible');
|
||||
if ((me.options.offsetX == null) && (bVisible))
|
||||
@@ -216,7 +216,7 @@ $(function()
|
||||
var me = this;
|
||||
this.oUploadDlg = $('<div><p>'+this.options.labels['pick_icon_file']+'</p><p><input type="file" accept="image/*" name="file" id="file"/></p></div>');
|
||||
this.element.after(this.oUploadDlg);
|
||||
$('input[type=file]').bind('change', function() { me._do_upload(); });
|
||||
$('input[type=file]').on('change', function() { me._do_upload(); });
|
||||
this.oUploadDlg.dialog({
|
||||
width: 400,
|
||||
modal: true,
|
||||
|
||||
@@ -68,7 +68,7 @@ $(function()
|
||||
.after(this.inputToBeRemoved)
|
||||
.after(this.indicator);
|
||||
|
||||
this.element.find('.selectList'+this.id).bind('change', function () {
|
||||
this.element.find('.selectList'+this.id).on('change', function () {
|
||||
me._updateButtons();
|
||||
});
|
||||
|
||||
@@ -206,7 +206,7 @@ $(function()
|
||||
me._onSearchToAdd();
|
||||
return false;
|
||||
});
|
||||
$('#SearchFormToAdd_'+me.id).resize(function () {
|
||||
$('#SearchFormToAdd_'+me.id).on('resize', function () {
|
||||
me._onSearchDlgUpdateSize();
|
||||
});
|
||||
|
||||
@@ -249,7 +249,7 @@ $(function()
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#count_'+me.id).change(function() {
|
||||
$('#count_'+me.id).on('change', function() {
|
||||
var c = this.value;
|
||||
me._onUpdateDlgButtons(c);
|
||||
});
|
||||
@@ -298,7 +298,7 @@ $(function()
|
||||
$.post(this.options.submit_to, oParams, function(data) {
|
||||
|
||||
$('#SearchResultsToAdd_'+me.id).html(data);
|
||||
$('#count_'+me.id).change(function() {
|
||||
$('#count_'+me.id).on('change', function() {
|
||||
var c = this.value;
|
||||
me._onUpdateDlgButtons(c);
|
||||
});
|
||||
|
||||
@@ -162,7 +162,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
if (me.bDoSearch) {
|
||||
me.SearchObjectsToAdd();
|
||||
} else {
|
||||
$('#count_'+me.id).change(function () {
|
||||
$('#count_'+me.id).on('change', function () {
|
||||
let c = this.value;
|
||||
me.UpdateButtons(c);
|
||||
});
|
||||
@@ -174,7 +174,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
||||
};
|
||||
|
||||
this.SearchObjectsToAdd = function () {
|
||||
$('#count_'+me.id).change(function () {
|
||||
$('#count_'+me.id).on('change', function () {
|
||||
let c = this.value;
|
||||
me.UpdateButtons(c);
|
||||
});
|
||||
|
||||
@@ -206,7 +206,7 @@ function SearchFormForeignKeys(id, sTargetClass, sAttCode, oSearchWidgetElmt, sF
|
||||
$('#fr_'+me.id+' input:radio').on('click', function() { me.UpdateButtons(); });
|
||||
me.UpdateButtons();
|
||||
me.ajax_request = null;
|
||||
$('#count_'+me.id).change(function(){
|
||||
$('#count_'+me.id).on('change', function(){
|
||||
me.UpdateButtons();
|
||||
});
|
||||
me.UpdateSizes();
|
||||
|
||||
@@ -34,11 +34,11 @@ $(function () {
|
||||
this._flatten_fields(this.options.fields);
|
||||
this.sId = this.element.attr('id');
|
||||
this.element.addClass('itop-tabularfieldsselector');
|
||||
this.element.parent().bind('form-part-activate', function () {
|
||||
this.element.parent().on('form-part-activate', function () {
|
||||
me._update_from_holder();
|
||||
me._update_preview();
|
||||
});
|
||||
this.element.parent().bind('validate', function () {
|
||||
this.element.parent().on('validate', function () {
|
||||
me.validate();
|
||||
});
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ function ReloadSearchForm(divId, sClassName, sBaseClass, sContext, sTableId, sEx
|
||||
oDiv.empty();
|
||||
oDiv.append(data);
|
||||
oDiv.unblock();
|
||||
oDiv.parent().resize(); // Inform the parent that the form has just been (potentially) resized
|
||||
oDiv.parent().trigger('resize'); // Inform the parent that the form has just been (potentially) resized
|
||||
oDiv.find('form.search_form_handler').triggerHandler('itop.search.form.reloaded');
|
||||
}
|
||||
);
|
||||
|
||||
@@ -29,7 +29,7 @@ $('#dlg_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').dialog({
|
||||
|
||||
});
|
||||
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }} form').bind('submit.uilinksWizard', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.SearchObjectsToAdd);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').resize(oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }} form').on('submit.uilinksWizard', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.SearchObjectsToAdd);
|
||||
$('#SearchFormToAdd_{{ oUIBlock.oUILinksWidget.GetLinkedSetId() }}').on('resize', oWidget{{ oUIBlock.oUILinksWidget.GetInputId() }}.UpdateSizes);
|
||||
|
||||
{% endapply %}
|
||||
@@ -374,7 +374,7 @@ $('body').on('open_creation_modal.object.itop','#{{ oUIBlock.GetId() }}', functi
|
||||
{% endif %}
|
||||
|
||||
{% if oUIBlock.GetOption('sCountSelector') is not empty %}
|
||||
$('#{{ sListId }} [name="selectionCount"]').bind('change', function () {
|
||||
$('#{{ sListId }} [name="selectionCount"]').on('change', function () {
|
||||
$('{{ oUIBlock.GetOption('sCountSelector') }}').val($('#{{ sListId }} [name="selectionCount"]').val());
|
||||
$('{{ oUIBlock.GetOption('sCountSelector') }}').trigger('change');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user