mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update events
This commit is contained in:
parent
08c6ef7935
commit
0e0fa54547
17 changed files with 140 additions and 141 deletions
|
@ -14,12 +14,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.159",
|
"version": "1.4.161",
|
||||||
"_release": "1.4.159",
|
"_release": "1.4.161",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.159",
|
"tag": "1.4.161",
|
||||||
"commit": "6320b765b9390fc57210d45c8e9bfcf66d1a2706"
|
"commit": "da357c3660e6956a59327fdd9d90506d16dc4b5c"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.1",
|
"_target": "^1.2.1",
|
||||||
|
|
|
@ -110,6 +110,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
|
||||||
var value = alphaPickerButton.getAttribute('data-value');
|
var value = alphaPickerButton.getAttribute('data-value');
|
||||||
|
|
||||||
element.dispatchEvent(new CustomEvent("alphavalueclicked", {
|
element.dispatchEvent(new CustomEvent("alphavalueclicked", {
|
||||||
|
cancelable: false,
|
||||||
detail: {
|
detail: {
|
||||||
value: value
|
value: value
|
||||||
}
|
}
|
||||||
|
@ -247,6 +248,7 @@ define(['focusManager', 'css!./style.css', 'paper-icon-button-light', 'material-
|
||||||
|
|
||||||
if (applyValue) {
|
if (applyValue) {
|
||||||
element.dispatchEvent(new CustomEvent("alphavaluechanged", {
|
element.dispatchEvent(new CustomEvent("alphavaluechanged", {
|
||||||
|
cancelable: false,
|
||||||
detail: {
|
detail: {
|
||||||
value: value
|
value: value
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,37 @@ define([], function () {
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var supportsCaptureOption = false;
|
||||||
|
try {
|
||||||
|
var opts = Object.defineProperty({}, 'capture', {
|
||||||
|
get: function () {
|
||||||
|
supportsCaptureOption = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.addEventListener("test", null, opts);
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
|
function addEventListenerWithOptions(target, type, handler, options) {
|
||||||
|
var optionsOrCapture = options;
|
||||||
|
if (!supportsCaptureOption) {
|
||||||
|
optionsOrCapture = options.capture;
|
||||||
|
}
|
||||||
|
target.addEventListener(type, handler, optionsOrCapture);
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeEventListenerWithOptions(target, type, handler, options) {
|
||||||
|
var optionsOrCapture = options;
|
||||||
|
if (!supportsCaptureOption) {
|
||||||
|
optionsOrCapture = options.capture;
|
||||||
|
}
|
||||||
|
target.removeEventListener(type, handler, optionsOrCapture);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
parentWithAttribute: parentWithAttribute,
|
parentWithAttribute: parentWithAttribute,
|
||||||
parentWithClass: parentWithClass,
|
parentWithClass: parentWithClass,
|
||||||
parentWithTag: parentWithTag
|
parentWithTag: parentWithTag,
|
||||||
|
addEventListener: addEventListenerWithOptions,
|
||||||
|
removeEventListener: removeEventListenerWithOptions
|
||||||
};
|
};
|
||||||
});
|
});
|
|
@ -1,4 +1,4 @@
|
||||||
define(['browser', 'css!./emby-button', 'registerElement'], function (browser) {
|
define(['browser', 'dom', 'css!./emby-button', 'registerElement'], function (browser, dom) {
|
||||||
|
|
||||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||||
|
|
||||||
|
@ -66,11 +66,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableAnimation()) {
|
if (enableAnimation()) {
|
||||||
this.addEventListener('keydown', onKeyDown);
|
dom.addEventListener(this, 'keydown', onKeyDown, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
if (browser.safari) {
|
if (browser.safari) {
|
||||||
this.addEventListener('click', animateButton);
|
dom.addEventListener(this, 'click', animateButton, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this.addEventListener('mousedown', onMouseDown);
|
dom.addEventListener(this, 'mousedown', onMouseDown, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
//this.addEventListener('touchstart', animateButton);
|
//this.addEventListener('touchstart', animateButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['browser', 'css!./emby-button', 'registerElement'], function (browser) {
|
define(['browser', 'dom', 'css!./emby-button', 'registerElement'], function (browser, dom) {
|
||||||
|
|
||||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||||
|
|
||||||
|
@ -55,8 +55,12 @@
|
||||||
this.classList.add('paper-icon-button-light');
|
this.classList.add('paper-icon-button-light');
|
||||||
|
|
||||||
if (enableAnimation()) {
|
if (enableAnimation()) {
|
||||||
this.addEventListener('keydown', onKeyDown);
|
dom.addEventListener(this, 'keydown', onKeyDown, {
|
||||||
this.addEventListener('click', animateButton);
|
passive: true
|
||||||
|
});
|
||||||
|
dom.addEventListener(this, 'click', animateButton, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['layoutManager', 'browser', 'css!./emby-input', 'registerElement'], function (layoutManager, browser) {
|
define(['layoutManager', 'browser', 'dom', 'css!./emby-input', 'registerElement'], function (layoutManager, browser, dom) {
|
||||||
|
|
||||||
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
|
var EmbyInputPrototype = Object.create(HTMLInputElement.prototype);
|
||||||
|
|
||||||
|
@ -67,20 +67,31 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addEventListener('focus', function () {
|
dom.addEventListener(this, 'focus', function () {
|
||||||
onChange.call(this);
|
onChange.call(this);
|
||||||
label.classList.add('inputLabelFocused');
|
label.classList.add('inputLabelFocused');
|
||||||
label.classList.remove('inputLabelUnfocused');
|
label.classList.remove('inputLabelUnfocused');
|
||||||
|
}, {
|
||||||
|
passive: true
|
||||||
});
|
});
|
||||||
this.addEventListener('blur', function () {
|
|
||||||
|
dom.addEventListener(this, 'blur', function () {
|
||||||
onChange.call(this);
|
onChange.call(this);
|
||||||
label.classList.remove('inputLabelFocused');
|
label.classList.remove('inputLabelFocused');
|
||||||
label.classList.add('inputLabelUnfocused');
|
label.classList.add('inputLabelUnfocused');
|
||||||
|
}, {
|
||||||
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addEventListener('change', onChange);
|
dom.addEventListener(this, 'change', onChange, {
|
||||||
this.addEventListener('input', onChange);
|
passive: true
|
||||||
this.addEventListener('valueset', onChange);
|
});
|
||||||
|
dom.addEventListener(this, 'input', onChange, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
dom.addEventListener(this, 'valueset', onChange, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
|
||||||
onChange.call(this);
|
onChange.call(this);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['require', 'browser', 'globalize', 'connectionManager', 'serverNotifications', 'loading', 'datetime', 'focusManager', 'imageLoader', 'events', 'layoutManager', 'itemShortcuts', 'registrationservices', 'clearButtonStyle', 'css!./guide.css', 'material-icons', 'scrollStyles', 'emby-button'], function (require, browser, globalize, connectionManager, serverNotifications, loading, datetime, focusManager, imageLoader, events, layoutManager, itemShortcuts, registrationServices) {
|
define(['require', 'browser', 'globalize', 'connectionManager', 'serverNotifications', 'loading', 'datetime', 'focusManager', 'imageLoader', 'events', 'layoutManager', 'itemShortcuts', 'registrationservices', 'dom', 'clearButtonStyle', 'css!./guide.css', 'material-icons', 'scrollStyles', 'emby-button'], function (require, browser, globalize, connectionManager, serverNotifications, loading, datetime, focusManager, imageLoader, events, layoutManager, itemShortcuts, registrationServices, dom) {
|
||||||
|
|
||||||
function Guide(options) {
|
function Guide(options) {
|
||||||
|
|
||||||
|
@ -738,32 +738,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportsCaptureOption = false;
|
|
||||||
try {
|
|
||||||
var opts = Object.defineProperty({}, 'capture', {
|
|
||||||
get: function () {
|
|
||||||
supportsCaptureOption = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.addEventListener("test", null, opts);
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
function addEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.addEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.removeEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
function onTimerCreated(e, apiClient, data) {
|
function onTimerCreated(e, apiClient, data) {
|
||||||
|
|
||||||
var programId = data.ProgramId;
|
var programId = data.ProgramId;
|
||||||
|
@ -826,13 +800,13 @@
|
||||||
|
|
||||||
programGrid.addEventListener('focus', onProgramGridFocus, true);
|
programGrid.addEventListener('focus', onProgramGridFocus, true);
|
||||||
|
|
||||||
addEventListenerWithOptions(programGrid, 'scroll', function (e) {
|
dom.addEventListener(programGrid, 'scroll', function (e) {
|
||||||
onProgramGridScroll(context, this, timeslotHeaders);
|
onProgramGridScroll(context, this, timeslotHeaders);
|
||||||
}, {
|
}, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
addEventListenerWithOptions(timeslotHeaders, 'scroll', function () {
|
dom.addEventListener(timeslotHeaders, 'scroll', function () {
|
||||||
onTimeslotHeadersScroll(context, this, programGrid);
|
onTimeslotHeadersScroll(context, this, programGrid);
|
||||||
}, {
|
}, {
|
||||||
passive: true
|
passive: true
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser'], function (visibleinviewport, imageFetcher, layoutManager, events, browser) {
|
define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser', 'dom'], function (visibleinviewport, imageFetcher, layoutManager, events, browser, dom) {
|
||||||
|
|
||||||
var thresholdX;
|
var thresholdX;
|
||||||
var thresholdY;
|
var thresholdY;
|
||||||
|
@ -91,32 +91,6 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var supportsCaptureOption = false;
|
|
||||||
try {
|
|
||||||
var opts = Object.defineProperty({}, 'capture', {
|
|
||||||
get: function () {
|
|
||||||
supportsCaptureOption = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.addEventListener("test", null, opts);
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
function addEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.addEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.removeEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
function unveilWithIntersection(images, root) {
|
function unveilWithIntersection(images, root) {
|
||||||
|
|
||||||
var filledCount = 0;
|
var filledCount = 0;
|
||||||
|
@ -185,19 +159,19 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!images.length) {
|
if (!images.length) {
|
||||||
removeEventListenerWithOptions(document, 'focus', unveil, {
|
dom.removeEventListener(document, 'focus', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
removeEventListenerWithOptions(document, 'scroll', unveil, {
|
dom.removeEventListener(document, 'scroll', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
removeEventListenerWithOptions(document, wheelEvent, unveil, {
|
dom.removeEventListener(document, wheelEvent, unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
removeEventListenerWithOptions(window, 'resize', unveil, {
|
dom.removeEventListener(window, 'resize', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
@ -216,19 +190,19 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventListenerWithOptions(document, 'focus', unveil, {
|
dom.addEventListener(document, 'focus', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
addEventListenerWithOptions(document, 'scroll', unveil, {
|
dom.addEventListener(document, 'scroll', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
addEventListenerWithOptions(document, wheelEvent, unveil, {
|
dom.addEventListener(document, wheelEvent, unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
addEventListenerWithOptions(window, 'resize', unveil, {
|
dom.addEventListener(window, 'resize', unveil, {
|
||||||
capture: true,
|
capture: true,
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['playbackManager', 'focusManager', 'embyRouter'], function (playbackManager, focusManager, embyRouter) {
|
define(['playbackManager', 'focusManager', 'embyRouter', 'dom'], function (playbackManager, focusManager, embyRouter, dom) {
|
||||||
|
|
||||||
var lastInputTime = new Date().getTime();
|
var lastInputTime = new Date().getTime();
|
||||||
|
|
||||||
|
@ -231,7 +231,9 @@ define(['playbackManager', 'focusManager', 'embyRouter'], function (playbackMana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('click', notify);
|
dom.addEventListener(document, 'click', notify, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
trigger: handleCommand,
|
trigger: handleCommand,
|
||||||
|
|
|
@ -243,7 +243,9 @@
|
||||||
|
|
||||||
this.parent.addEventListener('mouseenter', onHoverIn, true);
|
this.parent.addEventListener('mouseenter', onHoverIn, true);
|
||||||
this.parent.addEventListener('mouseleave', onHoverOut, true);
|
this.parent.addEventListener('mouseleave', onHoverOut, true);
|
||||||
this.parent.addEventListener("touchstart", preventTouchHover);
|
dom.parent.addEventListener(this.parent, "touchstart", preventTouchHover, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemHoverMenu.prototype = {
|
ItemHoverMenu.prototype = {
|
||||||
|
@ -253,7 +255,10 @@
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
this.parent.removeEventListener('mouseenter', onHoverIn, true);
|
this.parent.removeEventListener('mouseenter', onHoverIn, true);
|
||||||
this.parent.removeEventListener('mouseleave', onHoverOut, true);
|
this.parent.removeEventListener('mouseleave', onHoverOut, true);
|
||||||
this.parent.removeEventListener("touchstart", preventTouchHover);
|
|
||||||
|
dom.parent.removeEventListener(this.parent, "touchstart", preventTouchHover, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,4 @@
|
||||||
define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutManager) {
|
define(['browser', 'layoutManager', 'dom', 'scrollStyles'], function (browser, layoutManager, dom) {
|
||||||
|
|
||||||
var supportsCaptureOption = false;
|
|
||||||
try {
|
|
||||||
var opts = Object.defineProperty({}, 'capture', {
|
|
||||||
get: function () {
|
|
||||||
supportsCaptureOption = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.addEventListener("test", null, opts);
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
function addEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.addEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeEventListenerWithOptions(target, type, handler, options) {
|
|
||||||
var optionsOrCapture = options;
|
|
||||||
if (!supportsCaptureOption) {
|
|
||||||
optionsOrCapture = options.capture;
|
|
||||||
}
|
|
||||||
target.removeEventListener(type, handler, optionsOrCapture);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return type of the value.
|
* Return type of the value.
|
||||||
|
@ -102,13 +76,9 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
||||||
var namespace = pluginName;
|
var namespace = pluginName;
|
||||||
|
|
||||||
// Other global values
|
// Other global values
|
||||||
var dragInitEventNames = ['touchstart', 'mousedown'];
|
|
||||||
var dragInitEvents = 'touchstart.' + namespace + ' mousedown.' + namespace;
|
|
||||||
var dragMouseEvents = ['mousemove', 'mouseup'];
|
var dragMouseEvents = ['mousemove', 'mouseup'];
|
||||||
var dragTouchEvents = ['touchmove', 'touchend'];
|
var dragTouchEvents = ['touchmove', 'touchend'];
|
||||||
var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel');
|
var wheelEvent = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel' : 'mousewheel');
|
||||||
var clickEvent = 'click.' + namespace;
|
|
||||||
var mouseDownEvent = 'mousedown.' + namespace;
|
|
||||||
var interactiveElements = ['INPUT', 'SELECT', 'TEXTAREA'];
|
var interactiveElements = ['INPUT', 'SELECT', 'TEXTAREA'];
|
||||||
var tmpArray = [];
|
var tmpArray = [];
|
||||||
var time;
|
var time;
|
||||||
|
@ -926,14 +896,20 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
||||||
window.removeEventListener('resize', onResize, true);
|
window.removeEventListener('resize', onResize, true);
|
||||||
|
|
||||||
// Reset native FRAME element scroll
|
// Reset native FRAME element scroll
|
||||||
removeEventListenerWithOptions(frameElement, 'scroll', resetScroll, {
|
dom.removeEventListener(frameElement, 'scroll', resetScroll, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
removeEventListenerWithOptions(scrollSource, wheelEvent, scrollHandler, {
|
dom.removeEventListener(scrollSource, wheelEvent, scrollHandler, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dom.removeEventListener(dragSourceElement, 'touchstart', dragInitSlidee, {
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
|
|
||||||
|
dragSourceElement.removeEventListener('mousedown', dragInitSlidee);
|
||||||
|
|
||||||
// Reset initialized status and return the instance
|
// Reset initialized status and return the instance
|
||||||
self.initialized = 0;
|
self.initialized = 0;
|
||||||
return self;
|
return self;
|
||||||
|
@ -991,22 +967,24 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transform) {
|
if (transform) {
|
||||||
dragInitEventNames.forEach(function (eventName) {
|
|
||||||
dragSourceElement.addEventListener(eventName, dragInitSlidee);
|
dom.addEventListener(dragSourceElement, 'touchstart', dragInitSlidee, {
|
||||||
|
passive: true
|
||||||
});
|
});
|
||||||
|
dragSourceElement.addEventListener('mousedown', dragInitSlidee);
|
||||||
|
|
||||||
if (!o.scrollWidth) {
|
if (!o.scrollWidth) {
|
||||||
window.addEventListener('resize', onResize, true);
|
window.addEventListener('resize', onResize, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!o.horizontal) {
|
if (!o.horizontal) {
|
||||||
addEventListenerWithOptions(frameElement, 'scroll', resetScroll, {
|
dom.addEventListener(frameElement, 'scroll', resetScroll, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scrolling navigation
|
// Scrolling navigation
|
||||||
addEventListenerWithOptions(scrollSource, wheelEvent, scrollHandler, {
|
dom.addEventListener(scrollSource, wheelEvent, scrollHandler, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1015,7 +993,7 @@ define(['browser', 'layoutManager', 'scrollStyles'], function (browser, layoutMa
|
||||||
// Don't bind to mouse events with vertical scroll since the mouse wheel can handle this natively
|
// Don't bind to mouse events with vertical scroll since the mouse wheel can handle this natively
|
||||||
|
|
||||||
// Scrolling navigation
|
// Scrolling navigation
|
||||||
addEventListenerWithOptions(scrollSource, wheelEvent, scrollHandler, {
|
dom.addEventListener(scrollSource, wheelEvent, scrollHandler, {
|
||||||
passive: true
|
passive: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
define(['focusManager', 'scrollStyles'], function (focusManager) {
|
define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
|
||||||
|
|
||||||
function getOffsets(elems) {
|
function getOffsets(elems) {
|
||||||
|
|
||||||
|
@ -107,16 +107,28 @@ define(['focusManager', 'scrollStyles'], function (focusManager) {
|
||||||
centerFocus: {
|
centerFocus: {
|
||||||
on: function (element, horizontal) {
|
on: function (element, horizontal) {
|
||||||
if (horizontal) {
|
if (horizontal) {
|
||||||
element.addEventListener('focus', centerOnFocusHorizontal, true);
|
dom.addEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
element.addEventListener('focus', centerOnFocusVertical, true);
|
dom.addEventListener(element, 'focus', centerOnFocusVertical, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
off: function (element, horizontal) {
|
off: function (element, horizontal) {
|
||||||
if (horizontal) {
|
if (horizontal) {
|
||||||
element.removeEventListener('focus', centerOnFocusHorizontal, true);
|
dom.removeEventListener(element, 'focus', centerOnFocusHorizontal, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
element.removeEventListener('focus', centerOnFocusVertical, true);
|
dom.removeEventListener(element, 'focus', centerOnFocusVertical, {
|
||||||
|
capture: true,
|
||||||
|
passive: true
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
html += '<h1>' + globalize.translate('sharedcomponents#MySubtitles') + '</h1>';
|
html += '<h1>' + globalize.translate('sharedcomponents#MySubtitles') + '</h1>';
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
html += '<div class="paperList clear">';
|
html += '<div class="paperList paperList-clear">';
|
||||||
} else {
|
} else {
|
||||||
html += '<div class="paperList">';
|
html += '<div class="paperList">';
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
}
|
}
|
||||||
html += '<h1>' + provider + '</h1>';
|
html += '<h1>' + provider + '</h1>';
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
html += '<div class="paperList clear">';
|
html += '<div class="paperList paperList-clear">';
|
||||||
} else {
|
} else {
|
||||||
html += '<div class="paperList">';
|
html += '<div class="paperList">';
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,7 +247,10 @@ define(['browser', 'css!./viewcontainer-lite'], function (browser) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function triggerDestroy(view) {
|
function triggerDestroy(view) {
|
||||||
view.dispatchEvent(new CustomEvent("viewdestroy", {}));
|
|
||||||
|
view.dispatchEvent(new CustomEvent('viewdestroy', {
|
||||||
|
cancelable: false
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
|
|
@ -28,14 +28,14 @@
|
||||||
"web-component-tester": "^4.0.0"
|
"web-component-tester": "^4.0.0"
|
||||||
},
|
},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"homepage": "https://github.com/PolymerElements/iron-flex-layout",
|
"homepage": "https://github.com/polymerelements/iron-flex-layout",
|
||||||
"_release": "1.3.1",
|
"_release": "1.3.1",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.3.1",
|
"tag": "v1.3.1",
|
||||||
"commit": "6d88f29f3a7181daa2a5c7f678de44f0a0e6a717"
|
"commit": "6d88f29f3a7181daa2a5c7f678de44f0a0e6a717"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-flex-layout.git",
|
"_source": "git://github.com/polymerelements/iron-flex-layout.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "PolymerElements/iron-flex-layout"
|
"_originalSource": "polymerelements/iron-flex-layout"
|
||||||
}
|
}
|
|
@ -32,14 +32,14 @@
|
||||||
"web-component-tester": "^4.0.0",
|
"web-component-tester": "^4.0.0",
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
"homepage": "https://github.com/PolymerElements/iron-icon",
|
||||||
"_release": "1.0.9",
|
"_release": "1.0.9",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.9",
|
"tag": "v1.0.9",
|
||||||
"commit": "f6fb241901377e30e2c9c6cd47e3e8e8beb6574d"
|
"commit": "f6fb241901377e30e2c9c6cd47e3e8e8beb6574d"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
"_source": "git://github.com/PolymerElements/iron-icon.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "polymerelements/iron-icon"
|
"_originalSource": "PolymerElements/iron-icon"
|
||||||
}
|
}
|
|
@ -26,14 +26,14 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"main": "iron-meta.html",
|
"main": "iron-meta.html",
|
||||||
"homepage": "https://github.com/PolymerElements/iron-meta",
|
"homepage": "https://github.com/polymerelements/iron-meta",
|
||||||
"_release": "1.1.1",
|
"_release": "1.1.1",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.1.1",
|
"tag": "v1.1.1",
|
||||||
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f"
|
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-meta.git",
|
"_source": "git://github.com/polymerelements/iron-meta.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "PolymerElements/iron-meta"
|
"_originalSource": "polymerelements/iron-meta"
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue