Migration of emby-buttton, paper-icon-button-light, emby-collapse, emby-imput to ES6 modules
This commit is contained in:
parent
fd853a180a
commit
9e2d289265
5 changed files with 67 additions and 39 deletions
|
@ -1,11 +1,19 @@
|
|||
define(['browser', 'dom', 'layoutManager', 'shell', 'appRouter', 'apphost', 'css!./emby-button', 'registerElement'], function (browser, dom, layoutManager, shell, appRouter, appHost) {
|
||||
'use strict';
|
||||
import browser from 'browser';
|
||||
import dom from 'dom';
|
||||
import layoutManager from 'layoutManager';
|
||||
import shell from 'shell';
|
||||
import appRouter from 'appRouter';
|
||||
import appHost from 'apphost';
|
||||
import 'css!./emby-button';
|
||||
import 'registerElement';
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
var EmbyLinkButtonPrototype = Object.create(HTMLAnchorElement.prototype);
|
||||
/* eslint-disable indent */
|
||||
|
||||
const EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
const EmbyLinkButtonPrototype = Object.create(HTMLAnchorElement.prototype);
|
||||
|
||||
function onAnchorClick(e) {
|
||||
var href = this.getAttribute('href') || '';
|
||||
const href = this.getAttribute('href') || '';
|
||||
if (href !== '#') {
|
||||
if (this.getAttribute('target')) {
|
||||
if (!appHost.supports('targetblank')) {
|
||||
|
@ -66,5 +74,6 @@ define(['browser', 'dom', 'layoutManager', 'shell', 'appRouter', 'apphost', 'css
|
|||
extends: 'a'
|
||||
});
|
||||
|
||||
return EmbyButtonPrototype;
|
||||
});
|
||||
export default EmbyButtonPrototype;
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
define(['layoutManager', 'css!./emby-button', 'registerElement'], function (layoutManager) {
|
||||
'use strict';
|
||||
import layoutManager from 'layoutManager';
|
||||
import 'css!./emby-button';
|
||||
import 'registerElement';
|
||||
|
||||
var EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
/* eslint-disable indent */
|
||||
|
||||
const EmbyButtonPrototype = Object.create(HTMLButtonElement.prototype);
|
||||
|
||||
EmbyButtonPrototype.createdCallback = function () {
|
||||
this.classList.add('paper-icon-button-light');
|
||||
|
@ -15,4 +18,5 @@ define(['layoutManager', 'css!./emby-button', 'registerElement'], function (layo
|
|||
prototype: EmbyButtonPrototype,
|
||||
extends: 'button'
|
||||
});
|
||||
});
|
||||
|
||||
/* eslint-enable indent */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue