mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-05 10:28:34 +08:00
Add: Destroy api #35
This commit is contained in:
@@ -22,6 +22,15 @@ export default class NavBar extends util.Emitter
|
||||
this._$el.prepend(`<div class="eruda-nav-bar-item">${name}</div>`);
|
||||
this.resetStyle();
|
||||
}
|
||||
remove(name)
|
||||
{
|
||||
this._len--;
|
||||
this._$el.find('.eruda-nav-bar-item').each(function ()
|
||||
{
|
||||
let $this = util.$(this);
|
||||
if ($this.text().toLowerCase() === name.toLowerCase()) $this.remove();
|
||||
});
|
||||
}
|
||||
setHeight(height)
|
||||
{
|
||||
this._height = height;
|
||||
@@ -49,6 +58,10 @@ export default class NavBar extends util.Emitter
|
||||
}
|
||||
});
|
||||
}
|
||||
destroy()
|
||||
{
|
||||
this._$el.remove();
|
||||
}
|
||||
_resetBottomBar()
|
||||
{
|
||||
let $bottomBar = this._$bottomBar;
|
||||
|
||||
Reference in New Issue
Block a user