mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix input event
This commit is contained in:
parent
b33a3302ed
commit
4c99143f26
3 changed files with 21 additions and 16 deletions
|
@ -1,9 +1,10 @@
|
||||||
define(['css!./emby-button'], function (layoutManager, browser) {
|
define(['browser', 'css!./emby-button'], function (browser) {
|
||||||
|
|
||||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||||
|
|
||||||
function animateButton(e) {
|
function animateButton(e) {
|
||||||
|
|
||||||
|
var btn = this;
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
|
|
||||||
div.classList.add('ripple-effect');
|
div.classList.add('ripple-effect');
|
||||||
|
@ -16,7 +17,7 @@
|
||||||
div.style.top = offsetY + 'px';
|
div.style.top = offsetY + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
this.appendChild(div);
|
btn.appendChild(div);
|
||||||
|
|
||||||
div.addEventListener("animationend", function () {
|
div.addEventListener("animationend", function () {
|
||||||
div.parentNode.removeChild(div);
|
div.parentNode.removeChild(div);
|
||||||
|
@ -46,9 +47,12 @@
|
||||||
this.setAttribute('data-embybutton', 'true');
|
this.setAttribute('data-embybutton', 'true');
|
||||||
|
|
||||||
this.addEventListener('keydown', onKeyDown);
|
this.addEventListener('keydown', onKeyDown);
|
||||||
|
if (browser.safari) {
|
||||||
|
this.addEventListener('click', animateButton);
|
||||||
|
} else {
|
||||||
this.addEventListener('mousedown', onMouseDown);
|
this.addEventListener('mousedown', onMouseDown);
|
||||||
this.addEventListener('touchstart', animateButton);
|
//this.addEventListener('touchstart', animateButton);
|
||||||
//this.addEventListener('click', animateButton);
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
document.registerElement('emby-button', {
|
document.registerElement('emby-button', {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
||||||
|
|
||||||
|
if (descriptor.configurable) {
|
||||||
var baseSetMethod = descriptor.set;
|
var baseSetMethod = descriptor.set;
|
||||||
descriptor.set = function (value) {
|
descriptor.set = function (value) {
|
||||||
baseSetMethod.call(this, value);
|
baseSetMethod.call(this, value);
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
|
|
||||||
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
|
Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EmbyInputPrototype.createdCallback = function () {
|
EmbyInputPrototype.createdCallback = function () {
|
||||||
|
|
||||||
|
|
|
@ -1479,7 +1479,6 @@ var AppInfo = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
AppInfo.supportsExternalPlayers = true;
|
AppInfo.supportsExternalPlayers = true;
|
||||||
AppInfo.enableAppLayouts = true;
|
|
||||||
|
|
||||||
if (isCordova) {
|
if (isCordova) {
|
||||||
AppInfo.enableAppLayouts = true;
|
AppInfo.enableAppLayouts = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue