Commit 4ecdefb7 authored by akiraohgaki's avatar akiraohgaki

Remove NavbuttonComponent

parent a9377103
import BaseComponent from './BaseComponent.js';
export default class NavbuttonComponent extends BaseComponent {
static get componentObservedAttributes() {
return ['disabled', 'data-action', 'data-icon'];
}
init() {
this.contentRoot.addEventListener('click', this._handleClick.bind(this));
}
render() {
const disabled = this.hasAttribute('disabled') ? 'disabled' : '';
const icon = this.getAttribute('data-icon') || '';
return `
${this.sharedStyle}
<style>
:host {
display: inline-block;
width: 30px;
height: 30px;
}
</style>
<app-button data-icon="${icon}" ${disabled}></app-button>
`;
}
_handleClick() {
if (!this.hasAttribute('disabled')
&& this.getAttribute('data-action')
) {
this.dispatch(this.getAttribute('data-action'), {});
}
}
}
......@@ -29,8 +29,6 @@ ToolbarComponent.define('app-toolbar');
import WebviewComponent from './WebviewComponent.js';
WebviewComponent.define('app-webview');
import NavbuttonComponent from './NavbuttonComponent.js';
NavbuttonComponent.define('app-navbutton');
import MenubuttonComponent from './MenubuttonComponent.js';
MenubuttonComponent.define('app-menubutton');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment