mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update icon buttons
This commit is contained in:
parent
b7189bf6f8
commit
7f98cdfec2
27 changed files with 203 additions and 64 deletions
57
dashboard-ui/bower_components/emby-webcomponents/emby-button/paper-icon-button-light.js
vendored
Normal file
57
dashboard-ui/bower_components/emby-webcomponents/emby-button/paper-icon-button-light.js
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
define(['css!./emby-button'], function () {
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
|
||||
function animateButtonInternal(e, btn) {
|
||||
|
||||
var div = document.createElement('div');
|
||||
|
||||
div.classList.add('ripple-effect');
|
||||
|
||||
var offsetX = e.offsetX || 0;
|
||||
var offsetY = e.offsetY || 0;
|
||||
|
||||
if (offsetX > 0 && offsetY > 0) {
|
||||
div.style.left = offsetX + 'px';
|
||||
div.style.top = offsetY + 'px';
|
||||
}
|
||||
|
||||
btn.appendChild(div);
|
||||
|
||||
div.addEventListener("animationend", function () {
|
||||
div.parentNode.removeChild(div);
|
||||
}, false);
|
||||
}
|
||||
|
||||
function animateButton(e) {
|
||||
|
||||
var btn = this;
|
||||
requestAnimationFrame(function () {
|
||||
animateButtonInternal(e, btn);
|
||||
});
|
||||
}
|
||||
|
||||
function onKeyDown(e) {
|
||||
|
||||
if (e.keyCode == 13) {
|
||||
animateButton.call(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
EmbyButtonPrototype.attachedCallback = function () {
|
||||
|
||||
if (this.getAttribute('data-embybutton') == 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.setAttribute('data-embybutton', 'true');
|
||||
|
||||
this.addEventListener('keydown', onKeyDown);
|
||||
this.addEventListener('click', animateButton);
|
||||
};
|
||||
|
||||
document.registerElement('paper-icon-button-light', {
|
||||
prototype: EmbyButtonPrototype,
|
||||
extends: 'button'
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue