Author: adityasharma
Date: Tue Jan 8 05:06:43 2019 New Revision: 1850711 URL: http://svn.apache.org/viewvc?rev=1850711&view=rev Log: Improved: Replace jQuery.bind() with jQuery.on() (OFBIZ-10758) As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document. Modified: ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ordermgr-js/geoAutoCompleter.js ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/plugins/date/FromThruDateCheck.js ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/fieldlookup.js ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/js/application.js ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/js/application.js Modified: ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ordermgr-js/geoAutoCompleter.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ordermgr-js/geoAutoCompleter.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ordermgr-js/geoAutoCompleter.js (original) +++ ofbiz/ofbiz-framework/trunk/applications/commonext/webapp/ordermgr-js/geoAutoCompleter.js Tue Jan 8 05:06:43 2019 @@ -59,12 +59,12 @@ function callStateAutocompleter(data){ jQuery('#shipToStateProvinceGeoId').value = "_NA_"; jQuery("#shipStates").fadeOut("fast"); jQuery("#advice-required-shipToStateProvinceGeo").fadeOut("fast"); - jQuery("#shipToStateProvinceGeo").unbind("blur"); + jQuery("#shipToStateProvinceGeo").off("blur"); } else { jQuery('#shipToStateProvinceGeo').value = ""; jQuery('#shipToStateProvinceGeoId').value = ""; jQuery("#shipStates").fadeIn("fast"); - jQuery("#shipToStateProvinceGeo").bind("blur", function() { + jQuery("#shipToStateProvinceGeo").on("blur", function() { if (jQuery('#shipToStateProvinceGeo').val() == "") { jQuery("#advice-required-shipToStateProvinceGeo").fadeIn("fast"); } @@ -105,11 +105,11 @@ function getAssociatedStateList(countryI if (jQuery("#" + divId).is(':visible') || jQuery("#" + errorId).is(':visible')) { jQuery("#divId").fadeOut("fast"); jQuery("#errorId").fadeOut("fast"); - jQuery("#stateId").unbind("blur"); + jQuery("#stateId").off("blur"); } } else { jQuery("#divId").fadeIn("fast"); - jQuery("#stateId").bind("blur", function() { + jQuery("#stateId").on("blur", function() { if (jQuery("#" + stateId).val() == "") { jQuery("#errorId").fadeIn("fast") } Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/plugins/date/FromThruDateCheck.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/plugins/date/FromThruDateCheck.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/plugins/date/FromThruDateCheck.js (original) +++ ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/plugins/date/FromThruDateCheck.js Tue Jan 8 05:06:43 2019 @@ -21,8 +21,8 @@ //this code needs modifications yet its specific. jQuery(document).ready( function() { - jQuery("input[name*='fromDate']").bind('focusout', checkDate); - jQuery("input[name*='thruDate']").bind('focusout', checkDate); + jQuery("input[name*='fromDate']").on('focusout', checkDate); + jQuery("input[name*='thruDate']").on('focusout', checkDate); }); function checkDate() { Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js (original) +++ ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js Tue Jan 8 05:06:43 2019 @@ -633,7 +633,7 @@ function ajaxAutoCompleter(areaCsvString if (showDescription) { var lookupDescriptionLoader = new lookupDescriptionLoaded(areaArray[i], areaArray[i + 1], areaArray[i + 2], formName); lookupDescriptionLoader.update(); - jQuery("#" + areaArray[i]).bind('change lookup:changed', function(){ + jQuery("#" + areaArray[i]).on('change lookup:changed', function(){ lookupDescriptionLoader.update(); }); } Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/fieldlookup.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/fieldlookup.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/fieldlookup.js (original) +++ ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/fieldlookup.js Tue Jan 8 05:06:43 2019 @@ -374,7 +374,7 @@ var Lookup = function(options) { } function _dialogClose() { - jQuery(".ui-widget-overlay").unbind("click", _backgroundCloseClickEvent) + jQuery(".ui-widget-overlay").off("click", _backgroundCloseClickEvent) var prevLookup = null; if (ACTIVATED_LOOKUP) { Modified: ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/js/application.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/js/application.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/js/application.js (original) +++ ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/js/application.js Tue Jan 8 05:06:43 2019 @@ -180,7 +180,7 @@ var FORMALIZE = (function($, window, doc if (el.val() === text) { el.val(''); } - }).bind('reset', function() { + }).on('reset', function() { setTimeout(add_placeholder, 50); }); }); Modified: ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/js/application.js URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/js/application.js?rev=1850711&r1=1850710&r2=1850711&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/js/application.js (original) +++ ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/js/application.js Tue Jan 8 05:06:43 2019 @@ -180,7 +180,7 @@ var FORMALIZE = (function($, window, doc if (el.val() === text) { el.val(''); } - }).bind('reset', function() { + }).on('reset', function() { setTimeout(add_placeholder, 50); }); }); |
Free forum by Nabble | Edit this page |