Commit e24480c4 authored by akiraohgaki's avatar akiraohgaki

Add start/stop method in IndicatorComponent

parent d7483248
......@@ -151,7 +151,7 @@ export default class OmniboxComponent extends BaseComponent {
data-title="Open in Browser" data-icon="open_in_browser" data-size="small"></app-iconbutton>
</div>
</div>
<app-indicator data-state="inactive"></app-indicator>
<app-indicator></app-indicator>
</div>
<div data-palette data-state="${state}" class="fade-in">
......@@ -229,7 +229,8 @@ export default class OmniboxComponent extends BaseComponent {
}
_viewHandler_webview_loading(state) {
this.contentRoot.querySelector('app-indicator').setAttribute('data-state', state.isLoading ? 'active' : 'inactive');
const indicator = this.contentRoot.querySelector('app-indicator');
state.isLoading ? indicator.start() : indicator.stop();
}
_viewHandler_webview_page(state) {
......
......@@ -61,4 +61,16 @@ export default class IndicatorComponent extends BaseComponent {
`;
}
start() {
this.contentRoot.querySelector('div[data-container]').setAttribute('data-state', 'active');
this.contentRoot.querySelector('div[data-indicator]').setAttribute('data-state', 'active');
this.dispatch('indicator_start', {});
}
stop() {
this.contentRoot.querySelector('div[data-container]').setAttribute('data-state', 'inactive');
this.contentRoot.querySelector('div[data-indicator]').setAttribute('data-state', 'inactive');
this.dispatch('indicator_stop', {});
}
}
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