Skip to content

Remove usage of $.browser as it's unused and deprecated in jQuery. Fixes #14267 #14270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ define([
*/
navigateTo: function (code, scrollToElementId) {
var sortedItems = steps().sort(this.sortItems),
bodyElem = $.browser.safari || $.browser.chrome ? $('body') : $('html');
bodyElem = $('body');

scrollToElementId = scrollToElementId || null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ define([
'underscore',
'ko',
'uiComponent',
'Magento_Checkout/js/model/step-navigator',
'jquery/jquery.hashchange'
'Magento_Checkout/js/model/step-navigator'
], function ($, _, ko, Component, stepNavigator) {
'use strict';

Expand All @@ -25,7 +24,7 @@ define([
/** @inheritdoc */
initialize: function () {
this._super();
$(window).hashchange(_.bind(stepNavigator.handleHash, stepNavigator));
window.addEventListener('hashchange', _.bind(stepNavigator.handleHash, stepNavigator));
stepNavigator.handleHash();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
require([
"jquery",
"uiRegistry",
"jquery/jquery.hashchange",
"mage/mage",
"prototype",
"mage/adminhtml/form",
Expand Down Expand Up @@ -379,7 +378,7 @@ require([
return false;
};

jQuery(window).hashchange(handleHash);
window.addEventListener('hashchange', handleHash);
handleHash();

registry.set('adminSystemConfig', adminSystemConfig);
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Theme/view/base/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ var config = {
},
'shim': {
'jquery/jquery-migrate': ['jquery'],
'jquery/jquery.hashchange': ['jquery', 'jquery/jquery-migrate'],
'jquery/jstree/jquery.hotkeys': ['jquery'],
'jquery/hover-intent': ['jquery'],
'mage/adminhtml/backup': ['prototype'],
Expand All @@ -39,7 +38,6 @@ var config = {
'jquery/validate': 'jquery/jquery.validate',
'jquery/hover-intent': 'jquery/jquery.hoverIntent',
'jquery/file-uploader': 'jquery/fileUploader/jquery.fileupload-fp',
'jquery/jquery.hashchange': 'jquery/jquery.ba-hashchange.min',
'prototype': 'legacy-build.min',
'jquery/jquery-storageapi': 'jquery/jquery.storageapi.min',
'text': 'mage/requirejs/text',
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/User/view/adminhtml/web/app-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
require.config({
'waitSeconds': 0,
'shim': {
'jquery/jquery.hashchange': ['jquery'],
'jquery/jstree/jquery.hotkeys': ['jquery'],
'jquery/hover-intent': ['jquery'],
'mage/adminhtml/backup': ['prototype'],
Expand All @@ -28,7 +27,6 @@ require.config({
'jquery/validate': 'jquery/jquery.validate',
'jquery/hover-intent': 'jquery/jquery.hoverIntent',
'jquery/file-uploader': 'jquery/fileUploader/jquery.fileupload-fp',
'jquery/jquery.hashchange': 'jquery/jquery.ba-hashchange.min',
'prototype': 'prototype/prototype-amd',
'text': 'requirejs/text',
'domReady': 'requirejs/domReady',
Expand Down
1 change: 0 additions & 1 deletion app/design/frontend/Magento/blank/etc/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@
<exclude>
<item type="file">Lib::jquery/jquery.min.js</item>
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
<item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item>
<item type="file">Lib::jquery/jquery.details.js</item>
<item type="file">Lib::jquery/jquery.details.min.js</item>
<item type="file">Lib::jquery/jquery.hoverIntent.js</item>
Expand Down
1 change: 0 additions & 1 deletion app/design/frontend/Magento/luma/etc/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@
<exclude>
<item type="file">Lib::jquery/jquery.min.js</item>
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
<item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item>
<item type="file">Lib::jquery/jquery.details.js</item>
<item type="file">Lib::jquery/jquery.details.min.js</item>
<item type="file">Lib::jquery/jquery.hoverIntent.js</item>
Expand Down
1 change: 0 additions & 1 deletion app/design/frontend/Magento/rush/etc/view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@
<exclude>
<item type="file">Lib::jquery/jquery.min.js</item>
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
<item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item>
<item type="file">Lib::jquery/jquery.details.js</item>
<item type="file">Lib::jquery/jquery.details.min.js</item>
<item type="file">Lib::jquery/jquery.hoverIntent.js</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<exclude>
<item type="file">Lib::jquery/jquery.min.js</item>
<item type="file">Lib::jquery/jquery-ui-1.9.2.js</item>
<item type="file">Lib::jquery/jquery.ba-hashchange.min.js</item>
<item type="file">Lib::jquery/jquery.details.js</item>
<item type="file">Lib::jquery/jquery.details.min.js</item>
<item type="file">Lib::jquery/jquery.hoverIntent.js</item>
Expand Down
9 changes: 0 additions & 9 deletions lib/web/jquery/jquery.ba-hashchange.min.js

This file was deleted.

10 changes: 2 additions & 8 deletions lib/web/mage/popup-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,8 @@ define([
settings.windowURL = settings.windowURL || element.attr('href');

if (settings.centerBrowser) {
if ($.browser.msie) { // Hacked together for IE browsers
centeredY = window.screenTop - 120 +
(((document.documentElement.clientHeight + 120) / 2 - settings.height / 2));
centeredX = window.screenLeft + (((document.body.offsetWidth + 20) / 2 - settings.width / 2));
} else {
centeredY = window.screenY + ((window.outerHeight / 2 - settings.height / 2));
centeredX = window.screenX + ((window.outerWidth / 2 - settings.width / 2));
}
centeredY = window.screenY + ((window.outerHeight / 2 - settings.height / 2));
centeredX = window.screenX + ((window.outerWidth / 2 - settings.width / 2));
windowFeatures += ',left=' + centeredX + ',top=' + centeredY;
} else if (settings.centerScreen) {
centeredY = (screen.height - settings.height) / 2;
Expand Down