mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1723 from MrTimscampi/swiper6
Update Swiper to 6.1.1
This commit is contained in:
commit
a674cb68b6
6 changed files with 55 additions and 19 deletions
|
@ -79,7 +79,7 @@
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"screenfull": "^5.0.2",
|
"screenfull": "^5.0.2",
|
||||||
"sortablejs": "^1.10.2",
|
"sortablejs": "^1.10.2",
|
||||||
"swiper": "^5.4.5",
|
"swiper": "^6.1.1",
|
||||||
"webcomponents.js": "^0.7.24",
|
"webcomponents.js": "^0.7.24",
|
||||||
"whatwg-fetch": "^3.4.0"
|
"whatwg-fetch": "^3.4.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -60,8 +60,8 @@ _define('resize-observer-polyfill', function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// swiper
|
// swiper
|
||||||
const swiper = require('swiper/js/swiper');
|
const swiper = require('swiper/swiper-bundle');
|
||||||
require('swiper/css/swiper.min.css');
|
require('swiper/swiper-bundle.css');
|
||||||
_define('swiper', function() {
|
_define('swiper', function() {
|
||||||
return swiper;
|
return swiper;
|
||||||
});
|
});
|
||||||
|
|
|
@ -256,7 +256,7 @@ export default function (options) {
|
||||||
/**
|
/**
|
||||||
* Handles zoom changes.
|
* Handles zoom changes.
|
||||||
*/
|
*/
|
||||||
function onZoomChange(scale, imageEl, slideEl) {
|
function onZoomChange(swiper, scale, imageEl, slideEl) {
|
||||||
const zoomImage = slideEl.querySelector('.swiper-zoom-fakeimg');
|
const zoomImage = slideEl.querySelector('.swiper-zoom-fakeimg');
|
||||||
|
|
||||||
if (zoomImage) {
|
if (zoomImage) {
|
||||||
|
|
34
src/legacy/vendorStyles.js
Normal file
34
src/legacy/vendorStyles.js
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// Polyfill for vendor prefixed style properties
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
const vendorProperties = {
|
||||||
|
'transform': ['webkitTransform'],
|
||||||
|
'transition': ['webkitTransition']
|
||||||
|
};
|
||||||
|
|
||||||
|
const elem = document.createElement('div');
|
||||||
|
|
||||||
|
function polyfillProperty(name) {
|
||||||
|
if (!(name in elem.style)) {
|
||||||
|
(vendorProperties[name] || []).every((vendorName) => {
|
||||||
|
if (vendorName in elem.style) {
|
||||||
|
console.debug(`polyfill '${name}' with '${vendorName}'`);
|
||||||
|
|
||||||
|
Object.defineProperty(CSSStyleDeclaration.prototype, name, {
|
||||||
|
get: function () { return this[vendorName]; },
|
||||||
|
set: function (val) { this[vendorName] = val; }
|
||||||
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (elem.style instanceof CSSStyleDeclaration) {
|
||||||
|
polyfillProperty('transform');
|
||||||
|
polyfillProperty('transition');
|
||||||
|
}
|
||||||
|
})();
|
|
@ -222,6 +222,7 @@ function initClient() {
|
||||||
});
|
});
|
||||||
require(['mouseManager']);
|
require(['mouseManager']);
|
||||||
require(['focusPreventScroll']);
|
require(['focusPreventScroll']);
|
||||||
|
require(['vendorStyles']);
|
||||||
require(['autoFocuser'], function(autoFocuser) {
|
require(['autoFocuser'], function(autoFocuser) {
|
||||||
autoFocuser.enable();
|
autoFocuser.enable();
|
||||||
});
|
});
|
||||||
|
@ -655,6 +656,7 @@ function initClient() {
|
||||||
});
|
});
|
||||||
define('slideshow', [componentsPath + '/slideshow/slideshow'], returnFirstDependency);
|
define('slideshow', [componentsPath + '/slideshow/slideshow'], returnFirstDependency);
|
||||||
define('focusPreventScroll', ['legacy/focusPreventScroll'], returnFirstDependency);
|
define('focusPreventScroll', ['legacy/focusPreventScroll'], returnFirstDependency);
|
||||||
|
define('vendorStyles', ['legacy/vendorStyles'], returnFirstDependency);
|
||||||
define('userdataButtons', [componentsPath + '/userdatabuttons/userdatabuttons'], returnFirstDependency);
|
define('userdataButtons', [componentsPath + '/userdatabuttons/userdatabuttons'], returnFirstDependency);
|
||||||
define('listView', [componentsPath + '/listview/listview'], returnFirstDependency);
|
define('listView', [componentsPath + '/listview/listview'], returnFirstDependency);
|
||||||
define('indicators', [componentsPath + '/indicators/indicators'], returnFirstDependency);
|
define('indicators', [componentsPath + '/indicators/indicators'], returnFirstDependency);
|
||||||
|
|
30
yarn.lock
30
yarn.lock
|
@ -3499,12 +3499,12 @@ dom-serializer@0:
|
||||||
domelementtype "^2.0.1"
|
domelementtype "^2.0.1"
|
||||||
entities "^2.0.0"
|
entities "^2.0.0"
|
||||||
|
|
||||||
dom7@^2.1.5:
|
dom7@^3.0.0-alpha.7:
|
||||||
version "2.1.5"
|
version "3.0.0-alpha.7"
|
||||||
resolved "https://registry.yarnpkg.com/dom7/-/dom7-2.1.5.tgz#a79411017800b31d8400070cdaebbfc92c1f6377"
|
resolved "https://registry.yarnpkg.com/dom7/-/dom7-3.0.0-alpha.7.tgz#3b4ba156a83fa37fb3fa34b8ab40a1a41a56feb1"
|
||||||
integrity sha512-xnhwVgyOh3eD++/XGtH+5qBwYTgCm0aW91GFgPJ3XG+jlsRLyJivnbP0QmUBFhI+Oaz9FV0s7cxgXHezwOEBYA==
|
integrity sha512-3epkQPsKsbk2Dixqqgm2DT/KzhiAPByjDK7emu6owwFLbM5UoiqWKgdsH+6PpMEgoeR6Ex/bW1UbOe0FWZU0zg==
|
||||||
dependencies:
|
dependencies:
|
||||||
ssr-window "^2.0.0"
|
ssr-window "^3.0.0-alpha.1"
|
||||||
|
|
||||||
domain-browser@^1.1.1:
|
domain-browser@^1.1.1:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
|
@ -10395,10 +10395,10 @@ sshpk@^1.7.0:
|
||||||
safer-buffer "^2.0.2"
|
safer-buffer "^2.0.2"
|
||||||
tweetnacl "~0.14.0"
|
tweetnacl "~0.14.0"
|
||||||
|
|
||||||
ssr-window@^2.0.0:
|
ssr-window@^3.0.0-alpha.1, ssr-window@^3.0.0-alpha.4:
|
||||||
version "2.0.0"
|
version "3.0.0-alpha.4"
|
||||||
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-2.0.0.tgz#98c301aef99523317f8d69618f0010791096efc4"
|
resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-3.0.0-alpha.4.tgz#0c69a18c4305ecccdd8e11596155ca07b635f345"
|
||||||
integrity sha512-NXzN+/HPObKAx191H3zKlYomE5WrVIkoCB5IaSdvKokxTpjBdWfr0RaP+1Z5KOfDT0ZVz+2tdtiBkhsEQ9p+0A==
|
integrity sha512-+dBRP/pZ+VyITxTzD0lMDzDwN/BmfUl8xi2e6t5Nz4+FqUphfcBLB1OOUSYCRNFB25rD3c8AJRYpY5rHTbL+kg==
|
||||||
|
|
||||||
ssri@^6.0.1:
|
ssri@^6.0.1:
|
||||||
version "6.0.1"
|
version "6.0.1"
|
||||||
|
@ -10971,13 +10971,13 @@ svgo@^1.0.0, svgo@^1.3.2:
|
||||||
unquote "~1.1.1"
|
unquote "~1.1.1"
|
||||||
util.promisify "~1.0.0"
|
util.promisify "~1.0.0"
|
||||||
|
|
||||||
swiper@^5.4.5:
|
swiper@^6.1.1:
|
||||||
version "5.4.5"
|
version "6.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/swiper/-/swiper-5.4.5.tgz#a350f654bf68426dbb651793824925512d223c0f"
|
resolved "https://registry.yarnpkg.com/swiper/-/swiper-6.1.1.tgz#1246f28557dd33968dc43e926bc6e9e9a7b3850d"
|
||||||
integrity sha512-7QjA0XpdOmiMoClfaZ2lYN6ICHcMm72LXiY+NF4fQLFidigameaofvpjEEiTQuw3xm5eksG5hzkaRsjQX57vtA==
|
integrity sha512-w6rmEUnpuSWvzuIDJ+nTi7YQ4+pvr++zUnBO2VxkzOZbzQzcMNKNw1yj0RFEok682IHDPCs3LXSl8zSQ+zDEdw==
|
||||||
dependencies:
|
dependencies:
|
||||||
dom7 "^2.1.5"
|
dom7 "^3.0.0-alpha.7"
|
||||||
ssr-window "^2.0.0"
|
ssr-window "^3.0.0-alpha.4"
|
||||||
|
|
||||||
symbol-observable@1.0.1:
|
symbol-observable@1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue