diff --git a/src/Console/Console.es6 b/src/Console/Console.es6 index e3a49c3..7d1eb76 100644 --- a/src/Console/Console.es6 +++ b/src/Console/Console.es6 @@ -143,7 +143,7 @@ export default class Console extends Tool { if (log.type === 'error' && this.config.get('displayIfErr')) { - parent.show().showTool('console'); + parent.showTool('console').show(); } }); } diff --git a/src/Elements/Highlight.es6 b/src/Elements/Highlight.es6 index d4b810c..1904dce 100644 --- a/src/Elements/Highlight.es6 +++ b/src/Elements/Highlight.es6 @@ -90,6 +90,11 @@ export default class Highlight width: bw - pl - pr, height: bh - pt - pb }); + + this._$size.css({ + top: -mt - (top < 25 ? 0 : 25), + left: -ml + }).html(`${formatElName(this._target)} | ${width} × ${height}`); } _bindEvent() { @@ -103,9 +108,31 @@ export default class Highlight { $parent.append(require('./Highlight.hbs')()); - this._$el = util.$('.eruda-elements-highlight'); - this._$margin = this._$el.find('.eruda-margin'); - this._$padding = this._$el.find('.eruda-padding'); - this._$content = this._$el.find('.eruda-content'); + var $el = this._$el = util.$('.eruda-elements-highlight'); + this._$margin = $el.find('.eruda-margin'); + this._$padding = $el.find('.eruda-padding'); + this._$content = $el.find('.eruda-content'); + this._$size = $el.find('.eruda-size'); } } + +function formatElName(el) +{ + var {id, className} = el; + + var ret = `${el.tagName.toLowerCase()}`; + + if (id !== '') ret += `#${id}`; + + var classes = ''; + util.each(className.split(/\s+/g), (val) => + { + if (util.trim(val) === '') return; + + classes += `.${val}`; + }); + + ret += `${classes}`; + + return ret; +} \ No newline at end of file diff --git a/src/Elements/Highlight.hbs b/src/Elements/Highlight.hbs index df481a8..132419a 100644 --- a/src/Elements/Highlight.hbs +++ b/src/Elements/Highlight.hbs @@ -1,6 +1,9 @@