Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38) || kc === 33)) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return undefined;
}
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
return undefined;
}
if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
let inView = false;
// Check that swiper should be inside of visible area of window
if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) {
return undefined;
}
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const swiperOffset = swiper.$el.offset();
if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
const swiperCoord = [
[swiperOffset.left, swiperOffset.top],
[swiperOffset.left + swiper.width, swiperOffset.top],
[swiperOffset.left, swiperOffset.top + swiper.height],
[swiperOffset.left + swiper.width, swiperOffset.top + swiper.height],
];
for (let i = 0; i < swiperCoord.length; i += 1) {
const point = swiperCoord[i];
if (
point[0] >= 0 && point[0] <= windowWidth
&& point[1] >= 0 && point[1] <= windowHeight
) {
inView = true;
initCropBosPosition (newOpts) {
// 更新this.options
if (newOpts) {
this.options = Object.assign({}, this.options, newOpts)
}
let opts = this.options
let winWidth = window.innerWidth
let winHeight = window.innerHeight
// 宽度取设置宽度和屏幕宽度的最小值
let width = Math.min(opts.width, winWidth * 0.8)
let height = opts.height / opts.width * width
// 边界判断,如果高度超高(确定按钮不能显示),则重新计算裁剪框尺寸
if (height > winHeight * 0.8) {
height = winHeight * 0.8
width = opts.width / opts.height * height
}
let top = (winHeight - height) / 2
let left = (winWidth - width) / 2
let borderWidth = Math.max(top, left)
// 裁剪比例
this.cropRatio = opts.width / width
// 尺寸信息
this.cropBoxPos = {
if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38) || kc === 33)) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return undefined;
}
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
return undefined;
}
if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
let inView = false;
// Check that swiper should be inside of visible area of window
if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) {
return undefined;
}
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const swiperOffset = swiper.$el.offset();
if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
const swiperCoord = [
[swiperOffset.left, swiperOffset.top],
[swiperOffset.left + swiper.width, swiperOffset.top],
[swiperOffset.left, swiperOffset.top + swiper.height],
[swiperOffset.left + swiper.width, swiperOffset.top + swiper.height],
];
for (let i = 0; i < swiperCoord.length; i += 1) {
const point = swiperCoord[i];
if (
point[0] >= 0 && point[0] <= windowWidth
&& point[1] >= 0 && point[1] <= windowHeight
) {
inView = true;
if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38))) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return undefined;
}
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
return undefined;
}
if (swiper.params.keyboard.onlyInViewport && (kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
let inView = false;
// Check that swiper should be inside of visible area of window
if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) {
return undefined;
}
const windowWidth = window.innerWidth;
const windowHeight = window.innerHeight;
const swiperOffset = swiper.$el.offset();
if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
const swiperCoord = [
[swiperOffset.left, swiperOffset.top],
[swiperOffset.left + swiper.width, swiperOffset.top],
[swiperOffset.left, swiperOffset.top + swiper.height],
[swiperOffset.left + swiper.width, swiperOffset.top + swiper.height],
];
for (let i = 0; i < swiperCoord.length; i += 1) {
const point = swiperCoord[i];
if (
point[0] >= 0 && point[0] <= windowWidth &&
point[1] >= 0 && point[1] <= windowHeight
) {
inView = true;
device.needsStatusbarOverlay = function needsStatusbarOverlay() {
if ((device.webView || (device.android && device.cordova)) && (window.innerWidth * window.innerHeight === window.screen.width * window.screen.height)) {
if (device.iphoneX && (window.orientation === 90 || window.orientation === -90)) {
return false;
}
return true;
}
return false;
};
device.statusbar = device.needsStatusbarOverlay();
width() {
if (this[0] === window) return window.innerWidth
return this.length > 0 ? parseFloat(this.css('width')) : null
},
function width() {
if (this[0] === window) {
return window.innerWidth;
}
if (this.length > 0) {
return parseFloat(this.css('width'));
}
return null;
}
function outerWidth(includeMargins) {
function width() {
if (this[0] === window) {
return window.innerWidth;
}
if (this.length > 0) {
return parseFloat(this.css('width'));
}
return null;
}
function outerWidth(includeMargins) {
function width() {
if (this[0] === window) {
return window.innerWidth;
}
if (this.length > 0) {
return parseFloat(this.css('width'));
}
return null;
}
function outerWidth(includeMargins) {