diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 04097c742..6aaf0992f 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -1866,10 +1866,10 @@ HTML $sInputType = self::ENUM_INPUT_TYPE_MULTIPLE_INPUTS; $aEventsList[] = 'validate'; $aEventsList[] = 'change'; - $oPage->add_ready_script("$('#{$iId}_d').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); - $oPage->add_ready_script("$('#{$iId}_h').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); - $oPage->add_ready_script("$('#{$iId}_m').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); - $oPage->add_ready_script("$('#{$iId}_s').bind('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); + $oPage->add_ready_script("$('#{$iId}_d').on('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); + $oPage->add_ready_script("$('#{$iId}_h').on('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); + $oPage->add_ready_script("$('#{$iId}_m').on('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); + $oPage->add_ready_script("$('#{$iId}_s').on('keyup change', function(evt, sFormId) { return UpdateDuration('$iId'); });"); $aVal = AttributeDuration::SplitDuration($value); $sDays = ""; $sHours = ""; @@ -1879,7 +1879,7 @@ HTML 'UTF-8')."\"/>"; $sHTMLValue = Dict::Format('UI:DurationForm_Days_Hours_Minutes_Seconds', $sDays, $sHours, $sMinutes, $sSeconds).$sHidden." ".$sValidationSpan.$sReloadSpan; - $oPage->add_ready_script("$('#{$iId}').bind('update', function(evt, sFormId) { return ToggleDurationField('$iId'); });"); + $oPage->add_ready_script("$('#{$iId}').on('update', function(evt, sFormId) { return ToggleDurationField('$iId'); });"); break; case 'Password': @@ -2046,7 +2046,7 @@ EOF } $sOriginalValue = ($iFlags & OPT_ATT_MUSTCHANGE) ? json_encode($value->GetModifiedEntry('html')) : 'undefined'; - $oPage->add_ready_script("$('#$iId').bind('keyup change validate', function(evt, sFormId) { return ValidateCaseLogField('$iId', $bMandatory, sFormId, $sNullValue, $sOriginalValue) } );"); // Custom validation function + $oPage->add_ready_script("$('#$iId').on('keyup change validate', function(evt, sFormId) { return ValidateCaseLogField('$iId', $bMandatory, sFormId, $sNullValue, $sOriginalValue) } );"); // Custom validation function // Replace the text area with CKEditor // To change the default settings of the editor, @@ -2062,7 +2062,7 @@ EOF $oPage->add_ready_script( <<'; $sHTMLValue .= ''; $sHTMLValue .= ''; - $oPage->add_ready_script("$('#$iId :input').bind('keyup change validate', function(evt, sFormId) { return ValidateRedundancySettings('$iId',sFormId); } );"); // Custom validation function + $oPage->add_ready_script("$('#$iId :input').on('keyup change validate', function(evt, sFormId) { return ValidateRedundancySettings('$iId',sFormId); } );"); // Custom validation function break; case 'CustomFields': @@ -2278,12 +2278,12 @@ $('#{$iId}_console_form').console_form_handler($sFormHandlerOptions); $('#{$iId}_console_form').console_form_handler('alignColumns'); $('#{$iId}_console_form').console_form_handler('option', 'field_set', $('#{$iId}_field_set')); // field_change must be processed to refresh the hidden value at anytime -$('#{$iId}_console_form').bind('value_change', function() { $('#{$iId}').val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); }); +$('#{$iId}_console_form').on('value_change', function() { $('#{$iId}').val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); }); // Initialize the hidden value with current state // update_value is triggered when preparing the wizard helper object for ajax calls -$('#{$iId}').bind('update_value', function() { $(this).val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); }); +$('#{$iId}').on('update_value', function() { $(this).val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); }); // validate is triggered by CheckFields, on all the input fields, once at page init and once before submitting the form -$('#{$iId}').bind('validate', function(evt, sFormId) { +$('#{$iId}').on('validate', function(evt, sFormId) { $(this).val(JSON.stringify($('#{$iId}_field_set').triggerHandler('get_current_values'))); return ValidateCustomFields('$iId', sFormId); // Custom validation function }); @@ -2380,7 +2380,7 @@ EOF $sTip = 'data-tooltip-content="'.$sDisplayValueForHtml.'"'; $oPage->add_ready_script( <<add_ready_script(<<add_ready_script("$('#enable_{$sFormPrefix}{$sAttCode}').bind('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, true); } );\n"); + $oP->add_ready_script("$('#enable_{$sFormPrefix}{$sAttCode}').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 @@ -4501,7 +4501,7 @@ HTML { // When 'disabling' a field, all its dependent fields must be disabled too $sFieldList = "['{$sFormPrefix}".implode("','{$sFormPrefix}", $aDependents)."']"; - $oP->add_ready_script("$('#enable_{$sFormPrefix}{$sAttCode}').bind('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, false); } );\n"); + $oP->add_ready_script("$('#enable_{$sFormPrefix}{$sAttCode}').on('change', function(evt, sFormId) { return PropagateCheckBox( this.checked, $sFieldList, false); } );\n"); } if ($oAttDef->IsScalar() && $oAttDef->IsWritable()) { @@ -4638,8 +4638,8 @@ HTML $oP->add_ready_script($sReadyScript); $oP->add_ready_script( <<bMandatory ? 'true' : 'false'; $oP->add_ready_script( <<add_ready_script( <<bMandatory ? 'true' : 'false'; $oP->add_ready_script( <<add_ready_script( <<add_ready_script( <<iId} = new ExtKeyWidget('{$this->iId}', '{$this->sTargetClass}', '$sFilter', '$sTitle', true, $sWizHelper, '{$this->sAttCode}', $sJSSearchMode, $sJSDoSearch); oACWidget_{$this->iId}.emptyHtml = "

$sMessage

"; oACWidget_{$this->iId}.AddSelectize('$sJsonOptions','$value'); - $('#$this->iId').bind('update', function() { oACWidget_{$this->iId}.Update(); } ); - $('#$this->iId').bind('change', function() { $(this).trigger('extkeychange') } ); + $('#$this->iId').on('update', function() { oACWidget_{$this->iId}.Update(); } ); + $('#$this->iId').on('change', function() { $(this).trigger('extkeychange') } ); EOF ); @@ -561,8 +561,8 @@ EOF <<iId} = new ExtKeyWidget('{$this->iId}', '{$this->sTargetClass}', '$sFilter', '$sTitle', true, $sWizHelper, '{$this->sAttCode}', $sJSSearchMode, $sJSDoSearch); oACWidget_{$this->iId}.emptyHtml = "

$sMessage

"; - $('#$this->iId').bind('update', function() { oACWidget_{$this->iId}.Update(); } ); - $('#$this->iId').bind('change', function() { $(this).trigger('extkeychange') } ); + $('#$this->iId').on('update', function() { oACWidget_{$this->iId}.Update(); } ); + $('#$this->iId').on('change', function() { $(this).trigger('extkeychange') } ); EOF ); @@ -687,7 +687,7 @@ HTML $sDialogTitle = addslashes($sTitle); $oPage->add_ready_script(<<iId}').dialog({ width: $(window).width()*0.8, height: $(window).height()*0.8, autoOpen: false, modal: true, title: '$sDialogTitle', resizeStop: oACWidget_{$this->iId}.UpdateSizes, close: oACWidget_{$this->iId}.OnClose }); - $('#fs_{$this->iId}').bind('submit.uiAutocomplete', oACWidget_{$this->iId}.DoSearchObjects); + $('#fs_{$this->iId}').on('submit.uiAutocomplete', oACWidget_{$this->iId}.DoSearchObjects); $('#dc_{$this->iId}').resize(oACWidget_{$this->iId}.UpdateSizes); JS ); @@ -883,7 +883,7 @@ JS $oPage->add(''); $oPage->add_ready_script("\$('#ac_create_$this->iId').dialog({ width: 'auto', height: 'auto', maxHeight: $(window).height() - 50, autoOpen: false, modal: true, title: '$sDialogTitle'});\n"); $oPage->add_ready_script("$('#dcr_{$this->iId} form').removeAttr('onsubmit');"); - $oPage->add_ready_script("$('#dcr_{$this->iId} form').bind('submit.uilinksWizard', oACWidget_{$this->iId}.DoSelectObjectClass);"); + $oPage->add_ready_script("$('#dcr_{$this->iId} form').on('submit.uilinksWizard', oACWidget_{$this->iId}.DoSelectObjectClass);"); } /** diff --git a/application/ui.htmleditorwidget.class.inc.php b/application/ui.htmleditorwidget.class.inc.php index cecfe8aa8..efb7ae861 100644 --- a/application/ui.htmleditorwidget.class.inc.php +++ b/application/ui.htmleditorwidget.class.inc.php @@ -93,10 +93,10 @@ class UIHTMLEditorWidget // The most relevant solution would be to implement a plugin to CKEdit, and handle the internal events like: setData, insertHtml, insertElement, loadSnapshot, key, afterUndo, afterRedo // Could also be bound to 'instanceReady.ckeditor' - $oPage->add_ready_script("$('#$iId').bind('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n"); + $oPage->add_ready_script("$('#$iId').on('validate', function(evt, sFormId) { return ValidateCKEditField('$iId', '', {$this->m_sMandatory}, sFormId, '') } );\n"); $oPage->add_ready_script( <<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
 					<<