mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-01 10:18:35 +08:00
Add remove setting api
This commit is contained in:
@@ -28,6 +28,7 @@ export default class Sources extends Tool {
|
||||
super.destroy()
|
||||
|
||||
evalCss.remove(this._style)
|
||||
this._rmCfg()
|
||||
}
|
||||
set(type, val) {
|
||||
if (type === 'img') {
|
||||
@@ -133,6 +134,18 @@ export default class Sources extends Tool {
|
||||
this._rawTpl = require('./raw.hbs')
|
||||
this._iframeTpl = require('./iframe.hbs')
|
||||
}
|
||||
_rmCfg() {
|
||||
let cfg = this.config
|
||||
|
||||
let settings = this._container.get('settings')
|
||||
|
||||
if (!settings) return
|
||||
|
||||
settings
|
||||
.remove(cfg, 'showLineNum')
|
||||
.remove(cfg, 'formatCode')
|
||||
.remove('Sources')
|
||||
}
|
||||
_initCfg() {
|
||||
let cfg = (this.config = Settings.createCfg('sources', {
|
||||
showLineNum: true,
|
||||
|
||||
Reference in New Issue
Block a user