iId.'">';
- $oPage->add_ready_script("$('#$this->iId').bind('keyup change', function(evt) { return PasswordFieldChanged('$this->iId') } );"); // Bind to a custom event: validate
- $oPage->add_ready_script("$('#$this->iId').bind('keyup change validate', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
- $oPage->add_ready_script("$('#{$this->iId}_confirm').bind('keyup change', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
- $oPage->add_ready_script("$('#{$this->iId}').bind('update', function(evt, sFormId)
+ $oPage->add_ready_script("$('#$this->iId').on('keyup change', function(evt) { return PasswordFieldChanged('$this->iId') } );"); // Bind to a custom event: validate
+ $oPage->add_ready_script("$('#$this->iId').on('keyup change validate', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
+ $oPage->add_ready_script("$('#{$this->iId}_confirm').on('keyup change', function(evt, sFormId) { return ValidatePasswordField('$this->iId', sFormId) } );"); // Bind to a custom event: validate
+ $oPage->add_ready_script("$('#{$this->iId}').on('update', function(evt, sFormId)
{
if ($(this).prop('disabled'))
{
diff --git a/application/ui.searchformforeignkeys.class.inc.php b/application/ui.searchformforeignkeys.class.inc.php
index 8fd25a329..1ea213c66 100644
--- a/application/ui.searchformforeignkeys.class.inc.php
+++ b/application/ui.searchformforeignkeys.class.inc.php
@@ -72,7 +72,7 @@ HTML
$oPage->add_ready_script("$('#dlg_{$this->m_iInputId}').dialog({ width: $(window).width()*0.8, height: $(window).height()*0.8, autoOpen: false, modal: true, resizeStop: oForeignKeysWidget{$this->m_iInputId}.UpdateSizes });");
$oPage->add_ready_script("$('#dlg_{$this->m_iInputId}').dialog('option', {title:'$sTitle'});");
- $oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_iInputId} form').bind('submit.uilinksWizard', oForeignKeysWidget{$this->m_iInputId}.SearchObjectsToAdd);");
+ $oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_iInputId} form').on('submit.uilinksWizard', oForeignKeysWidget{$this->m_iInputId}.SearchObjectsToAdd);");
$oPage->add_ready_script("$('#SearchFormToAdd_{$this->m_iInputId}').resize(oForeignKeysWidget{$this->m_iInputId}.UpdateSizes);");
}
diff --git a/js/dashboard.js b/js/dashboard.js
index ab45e27ba..dc5680732 100644
--- a/js/dashboard.js
+++ b/js/dashboard.js
@@ -37,7 +37,7 @@ $(function()
this.element
.addClass('itop-dashboard')
- .bind('add_dashlet.itop_dashboard', function(event, oParams){
+ .on('add_dashlet.itop_dashboard', function(event, oParams){
me.add_dashlet(oParams);
});
@@ -62,7 +62,7 @@ $(function()
.removeClass('itop-dashboard');
this.ajax_div.remove();
- $(document).unbind('keyup.dashboard_editor');
+ $(document).off('keyup.dashboard_editor');
},
// _setOptions is called with a hash of all options that are changing
_setOptions: function () {
@@ -235,7 +235,7 @@ $(function()
this.element
.addClass('itop-runtimedashboard')
- .bind('mark_as_modified.itop-dashboard', function(){me.mark_as_modified();} );
+ .on('mark_as_modified.itop-dashboard', function(){me.mark_as_modified();} );
this.bModified = false;
},
diff --git a/js/dashlet.js b/js/dashlet.js
index 511e87ade..4d187b84d 100644
--- a/js/dashlet.js
+++ b/js/dashlet.js
@@ -55,7 +55,7 @@ $(function()
{
this.element
.removeClass('itop-dashlet')
- .unbind('click.itop-dashlet');
+ .off('click.itop-dashlet');
this.closeBox.remove();
},
diff --git a/js/extkeywidget.js b/js/extkeywidget.js
index ffefe5859..42d149394 100644
--- a/js/extkeywidget.js
+++ b/js/extkeywidget.js
@@ -531,7 +531,7 @@ function ExtKeyWidget(id, sTargetClass, sFilter, sTitle, bSelectMode, oWizHelper
$('#ac_create_'+me.id).dialog('open');
$('#ac_create_'+me.id).dialog("option", "close", me.OnCloseCreateObject);
// Modify the action of the cancel button
- $('#ac_create_'+me.id+' button.cancel').unbind('click').click(me.CloseCreateObject);
+ $('#ac_create_'+me.id+' button.cancel').off('click').on('click', me.CloseCreateObject);
me.ajax_request = null;
// Adjust the dialog's size to fit into the screen
if ($('#ac_create_'+me.id).width() > ($(window).width()-40))
diff --git a/js/linksdirectwidget.js b/js/linksdirectwidget.js
index 81bafcbfe..8285913b1 100644
--- a/js/linksdirectwidget.js
+++ b/js/linksdirectwidget.js
@@ -186,7 +186,7 @@ $(function()
$('body').append(me.oDlg);
me.oDlg.html(data);
me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function() { me._onCreateRow(); return false; } );
- me.oDlg.find('button.cancel').unbind('click').click( function() { me.oDlg.dialog('close'); } );
+ me.oDlg.find('button.cancel').off('click').on('click', function() { me.oDlg.dialog('close'); } );
me.oDlg.dialog({
title: me.options.labels['creation_title'],
@@ -232,8 +232,8 @@ $(function()
$('body').append(me.oDlg);
me.oDlg.html(data);
me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function() { me._onSearchToAdd(); return false; } );
- me.oDlg.find('button.cancel').unbind('click').click( function() { me.oDlg.dialog('close'); } );
- me.oDlg.find('button.ok').unbind('click').click( function() { me._onDoAdd(); } );
+ me.oDlg.find('button.cancel').off('click').on('click', function() { me.oDlg.dialog('close'); } );
+ me.oDlg.find('button.ok').off('click').on('click', function() { me._onDoAdd(); } );
$('#SearchFormToAdd_'+me.id).resize(function() { me._onSearchDlgUpdateSize(); });
me.oDlg.dialog({
@@ -427,7 +427,7 @@ $(function()
$.post(this.options.submit_to, oParams, function(data){
me.oDlg.html(data);
me.oDlg.find('form').removeAttr('onsubmit').bind('submit', function() { me._onCreateRow(); return false; } );
- me.oDlg.find('button.cancel').unbind('click').click( function() { me.oDlg.dialog('close'); } );
+ me.oDlg.find('button.cancel').off('click').on('click', function() { me.oDlg.dialog('close'); } );
me._updateDlgPosition();
});
},
diff --git a/js/property_field.js b/js/property_field.js
index 156c2956b..3d59179f0 100644
--- a/js/property_field.js
+++ b/js/property_field.js
@@ -27,7 +27,7 @@ $(function()
this.element
.addClass( "itop-property-field ibo-field" )
- .bind('apply_changes.itop-property-field', function(){me._do_apply();} );
+ .on('apply_changes.itop-property-field', function(){me._do_apply();} );
this.bModified = false;
@@ -35,11 +35,11 @@ $(function()
{
// In case there is an hidden input having the same id (somewhere else in the page), the change event does not occur unless the input loses the focus
// To reduce the impact, let's handle keyup as well
- $('#'+this.options.field_id, this.element).bind('change.itop-property-field keyup.itop-property-field', function() { me._on_change(); });
+ $('#'+this.options.field_id, this.element).on('change.itop-property-field keyup.itop-property-field', function() { me._on_change(); });
this.value = this._get_field_value();
}
- this.element.find(".prop_apply").bind('click.itop-property-field', function() { me._do_apply(); });
- this.element.find(".prop_cancel").bind('click.itop-property-field', function() { me._do_cancel(); });
+ this.element.find(".prop_apply").on('click.itop-property-field', function() { me._do_apply(); });
+ this.element.find(".prop_cancel").on('click.itop-property-field', function() { me._do_cancel(); });
this._refresh();
},
@@ -337,11 +337,11 @@ $(function()
this.element
.addClass( "itop-selector-property-field" );
- $('#'+this.options.field_id).bind('reverted init', function() {
+ $('#'+this.options.field_id).on('reverted init', function() {
me._update_subform();
}).trigger('init'); // initial refresh
- this.element.bind('subitem_changed', function() {
+ this.element.on('subitem_changed', function() {
me._on_subitem_changed();
});
},
diff --git a/js/tabularfieldsselector.js b/js/tabularfieldsselector.js
index 7fb2a0894..22eb42b9d 100644
--- a/js/tabularfieldsselector.js
+++ b/js/tabularfieldsselector.js
@@ -344,8 +344,8 @@ $(function () {
this.element
.removeClass('itop-tabularfieldsselector');
- this.element.parent().unbind('activate');
- this.element.parent().unbind('validate');
+ this.element.parent().off('activate');
+ this.element.parent().off('validate');
},
// _setOptions is called with a hash of all options that are changing
_setOptions: function () {
diff --git a/js/wizardhelper.js b/js/wizardhelper.js
index 5f00880c0..a901b7cc3 100644
--- a/js/wizardhelper.js
+++ b/js/wizardhelper.js
@@ -35,8 +35,8 @@
* \cmdbAbstractObject::GetFormElementForField and $aEventsList var)
*
* $('#2_name')
- * .unbind('change.dependencies')
- * .bind('change.dependencies', function(evt, sFormId) {
+ * .off('change.dependencies')
+ * .on('change.dependencies', function(evt, sFormId) {
* return oWizardHelper.UpdateDependentFields(['friendlyname']);
* }
* );
diff --git a/pages/UI.php b/pages/UI.php
index 69e3cb6ad..b8f9248fe 100644
--- a/pages/UI.php
+++ b/pages/UI.php
@@ -1364,14 +1364,14 @@ EOF
{
// When 'enabling' a field, all its prerequisites must be enabled too
$sFieldList = "['{$sFormPrefix}".implode("','{$sFormPrefix}", $aPrerequisites)."']";
- $oP->add_ready_script("$('#enable_{$sFieldInputId}').bind('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, true); } );\n");
+ $oP->add_ready_script("$('#enable_{$sFieldInputId}').on('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, true); } );\n");
}
$aDependents = MetaModel::GetDependentAttributes($sClass, $sAttCode); // List of attributes that are needed for the current one
if (count($aDependents) > 0)
{
// When 'disabling' a field, all its dependent fields must be disabled too
$sFieldList = "['{$sFormPrefix}".implode("','{$sFormPrefix}", $aDependents)."']";
- $oP->add_ready_script("$('#enable_{$sFieldInputId}').bind('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, false); } );\n");
+ $oP->add_ready_script("$('#enable_{$sFieldInputId}').on('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, false); } );\n");
}
$aArgs = array('this' => $oObj);
$sHTMLValue = cmdbAbstractObject::GetFormElementForField($oP, $sClass, $sAttCode, $oAttDef, $oObj->Get($sAttCode), $oObj->GetEditValue($sAttCode), $sFieldInputId, '', $iExpectCode, $aArgs);
diff --git a/setup/wizardsteps.class.inc.php b/setup/wizardsteps.class.inc.php
index e4ee0cd74..dd63e790e 100644
--- a/setup/wizardsteps.class.inc.php
+++ b/setup/wizardsteps.class.inc.php
@@ -2458,7 +2458,7 @@ EOF
$("#wiz_form").data("installation_status", "completed");
$('#progress').progression( {Current:100, Maximum: 100} );
WizardUpdateButtons();
- $("#btn_next").unbind("click.install");
+ $("#btn_next").off("click.install");
$("#btn_next").click();
EOF
);
diff --git a/sources/Renderer/Console/FieldRenderer/ConsoleSimpleFieldRenderer.php b/sources/Renderer/Console/FieldRenderer/ConsoleSimpleFieldRenderer.php
index 79ac1e0d3..6d6f1317c 100644
--- a/sources/Renderer/Console/FieldRenderer/ConsoleSimpleFieldRenderer.php
+++ b/sources/Renderer/Console/FieldRenderer/ConsoleSimpleFieldRenderer.php
@@ -211,11 +211,11 @@ EOF
$oOutput->AddHtml(Dict::Format('UI:DurationForm_Days_Hours_Minutes_Seconds', $sDays, $sHours, $sMinutes, $sSeconds));
$oOutput->AddHtml("");
- $oOutput->AddJs("$('#{$sId}_d').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
- $oOutput->AddJs("$('#{$sId}_h').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
- $oOutput->AddJs("$('#{$sId}_m').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
- $oOutput->AddJs("$('#{$sId}_s').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
- $oOutput->AddJs("$('#{$sId}').bind('update', function(evt, sFormId) { return ToggleDurationField('$sId'); });");
+ $oOutput->AddJs("$('#{$sId}_d').on('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
+ $oOutput->AddJs("$('#{$sId}_h').on('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
+ $oOutput->AddJs("$('#{$sId}_m').on('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
+ $oOutput->AddJs("$('#{$sId}_s').on('keyup change', function(evt, sFormId) { return UpdateDuration('$sId'); });");
+ $oOutput->AddJs("$('#{$sId}').on('update', function(evt, sFormId) { return ToggleDurationField('$sId'); });");
}
$oOutput->AddHtml('');
$oOutput->AddHtml('');
diff --git a/sources/application/UI/Base/Layout/NavigationMenu/NavigationMenu.php b/sources/application/UI/Base/Layout/NavigationMenu/NavigationMenu.php
index 93903d092..0a02f20ae 100644
--- a/sources/application/UI/Base/Layout/NavigationMenu/NavigationMenu.php
+++ b/sources/application/UI/Base/Layout/NavigationMenu/NavigationMenu.php
@@ -356,8 +356,8 @@ class NavigationMenu extends UIBlock
<<