From 4c99143f268b12a4d80992fd2027e3bd8e08beef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 5 Jun 2016 00:49:29 -0400 Subject: [PATCH] fix input event --- .../emby-button/emby-button.js | 16 +++++++++------ .../emby-input/emby-input.js | 20 ++++++++++--------- dashboard-ui/scripts/site.js | 1 - 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js index 41be6c3d79..ea6b1426d9 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-button/emby-button.js @@ -1,9 +1,10 @@ -define(['css!./emby-button'], function (layoutManager, browser) { +define(['browser', 'css!./emby-button'], function (browser) { var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype); function animateButton(e) { + var btn = this; var div = document.createElement('div'); div.classList.add('ripple-effect'); @@ -16,9 +17,9 @@ div.style.top = offsetY + 'px'; } - this.appendChild(div); + btn.appendChild(div); - div.addEventListener("animationend", function() { + div.addEventListener("animationend", function () { div.parentNode.removeChild(div); }, false); } @@ -46,9 +47,12 @@ this.setAttribute('data-embybutton', 'true'); this.addEventListener('keydown', onKeyDown); - this.addEventListener('mousedown', onMouseDown); - this.addEventListener('touchstart', animateButton); - //this.addEventListener('click', animateButton); + if (browser.safari) { + this.addEventListener('click', animateButton); + } else { + this.addEventListener('mousedown', onMouseDown); + //this.addEventListener('touchstart', animateButton); + } }; document.registerElement('emby-button', { diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js b/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js index 0c2bc70712..a932660a32 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-input/emby-input.js @@ -8,16 +8,18 @@ var descriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value'); - var baseSetMethod = descriptor.set; - descriptor.set = function (value) { - baseSetMethod.call(this, value); - this.dispatchEvent(new CustomEvent('valueset', { - bubbles: false, - cancelable: false - })); - } + if (descriptor.configurable) { + var baseSetMethod = descriptor.set; + descriptor.set = function (value) { + baseSetMethod.call(this, value); + this.dispatchEvent(new CustomEvent('valueset', { + bubbles: false, + cancelable: false + })); + } - Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor); + Object.defineProperty(HTMLInputElement.prototype, 'value', descriptor); + } } EmbyInputPrototype.createdCallback = function () { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 5b41f2f9cd..ea92476218 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1479,7 +1479,6 @@ var AppInfo = {}; } AppInfo.supportsExternalPlayers = true; - AppInfo.enableAppLayouts = true; if (isCordova) { AppInfo.enableAppLayouts = true;