1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Beautified all js in web dashboard

This commit is contained in:
Vasily 2018-10-23 01:05:09 +03:00
parent 5895f209e7
commit 6bfd795635
346 changed files with 72978 additions and 375 deletions

View file

@ -1 +1,22 @@
define(["css!./emby-toggle","registerElement"],function(){"use strict";function onKeyDown(e){if(13===e.keyCode)return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}var EmbyTogglePrototype=Object.create(HTMLInputElement.prototype);EmbyTogglePrototype.attachedCallback=function(){if("true"!==this.getAttribute("data-embytoggle")){this.setAttribute("data-embytoggle","true"),this.classList.add("mdl-switch__input");var labelElement=this.parentNode;labelElement.classList.add("mdl-switch"),labelElement.classList.add("mdl-js-switch");var labelTextElement=labelElement.querySelector("span");labelElement.insertAdjacentHTML("beforeend",'<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>'),labelTextElement.classList.add("toggleButtonLabel"),labelTextElement.classList.add("mdl-switch__label"),this.addEventListener("keydown",onKeyDown)}},document.registerElement("emby-toggle",{prototype:EmbyTogglePrototype,extends:"input"})});
define(["css!./emby-toggle", "registerElement"], function() {
"use strict";
function onKeyDown(e) {
if (13 === e.keyCode) return e.preventDefault(), this.checked = !this.checked, this.dispatchEvent(new CustomEvent("change", {
bubbles: !0
})), !1
}
var EmbyTogglePrototype = Object.create(HTMLInputElement.prototype);
EmbyTogglePrototype.attachedCallback = function() {
if ("true" !== this.getAttribute("data-embytoggle")) {
this.setAttribute("data-embytoggle", "true"), this.classList.add("mdl-switch__input");
var labelElement = this.parentNode;
labelElement.classList.add("mdl-switch"), labelElement.classList.add("mdl-js-switch");
var labelTextElement = labelElement.querySelector("span");
labelElement.insertAdjacentHTML("beforeend", '<div class="mdl-switch__trackContainer"><div class="mdl-switch__track"></div><div class="mdl-switch__thumb"><span class="mdl-switch__focus-helper"></span></div></div>'), labelTextElement.classList.add("toggleButtonLabel"), labelTextElement.classList.add("mdl-switch__label"), this.addEventListener("keydown", onKeyDown)
}
}, document.registerElement("emby-toggle", {
prototype: EmbyTogglePrototype,
extends: "input"
})
});