P5-2413 - Remove $(window).width() calls
This commit is contained in:
Vendored
+1
-2
@@ -2373,10 +2373,9 @@ module.exports = isFullscreen;
|
|||||||
|
|
||||||
},{}],31:[function(require,module,exports){
|
},{}],31:[function(require,module,exports){
|
||||||
'use strict';
|
'use strict';
|
||||||
/* globals $ */
|
|
||||||
|
|
||||||
function isMobile() {
|
function isMobile() {
|
||||||
return $(window).width() < 768;
|
return window.innerWidth < 768;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = isMobile;
|
module.exports = isMobile;
|
||||||
|
|||||||
@@ -98,9 +98,9 @@
|
|||||||
function getWrapperData() {
|
function getWrapperData() {
|
||||||
var $navbar = $('.image-editor__navbar');
|
var $navbar = $('.image-editor__navbar');
|
||||||
var isFullScreen = isFullscreen();
|
var isFullScreen = isFullscreen();
|
||||||
var isMobile = $window.width() <= 767;
|
var isMobile = window.innerWidth <= 767;
|
||||||
var windowHeight = window.innerHeight ? window.innerHeight : $window.height();
|
var windowHeight = window.innerHeight;
|
||||||
var windowWidth = window.innerWidth ? window.innerWidth : $window.width();
|
var windowWidth = window.innerWidth;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
width: isFullScreen ? windowWidth : (isMobile ? windowWidth : $wrapper.width()),
|
width: isFullScreen ? windowWidth : (isMobile ? windowWidth : $wrapper.width()),
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
/* globals $ */
|
|
||||||
|
|
||||||
function isMobile() {
|
function isMobile() {
|
||||||
return $(window).width() < 768;
|
return window.innerWidth < 768;
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = isMobile;
|
module.exports = isMobile;
|
||||||
|
|||||||
Reference in New Issue
Block a user