Dev: Small bugs

This commit is contained in:
surunzi
2016-05-04 16:09:36 +08:00
parent 89a8558e74
commit 33fe11502e
4 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import NavBar from './NavBar.es6'
import util from '../lib/util'
import Tool from './Tool.es6'
import config from '../lib/config.es6'
require('./DevTools.scss');
@@ -47,6 +48,8 @@ export default class DevTools
}
add(tool)
{
util.defaults(tool, new Tool());
var name = tool.name;
this._$tools.append('<div class="eruda-' + name + ' eruda-tool"></div>');

View File

@@ -61,8 +61,6 @@ export default class Elements extends Tool
var $bottomBar = this._$el.find('.eruda-bottom-bar');
var self = this;
$bottomBar.on('click', '.back', () => this._back())
.on('click', '.refresh', () => this._render())
.on('click', '.highlight', function ()

View File

@@ -9,6 +9,7 @@ import Info from './Info/Info.es6'
import Features from './Features/Features.es6'
import Settings from './Settings/Settings.es6'
import util from './lib/util'
import config from './lib/config.es6'
require('./style.scss');
require('./icon.css');
@@ -63,7 +64,7 @@ function appendContainer()
module.exports = {
get(name)
{
return devTools.get(name);
return util.isUndef(name) ? devTools : devTools.get(name);
},
add(tool)
{
@@ -79,7 +80,7 @@ module.exports = {
},
show(name)
{
devTools.showTool(name);
util.isUndef(name) ? devTools.show() : devTools.showTool(name);
return this;
},
@@ -89,6 +90,7 @@ module.exports = {
$container.remove();
window.eruda = undefined;
},
config,
util
};