mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-20 09:38:37 +08:00
Fix: Sources json viewer event binding
This commit is contained in:
@@ -204,7 +204,8 @@ export default class Sources extends Tool
|
||||
}
|
||||
_renderJson()
|
||||
{
|
||||
this._renderHtml(this._jsonTpl());
|
||||
// Using cache will keep binding json events to the same elements.
|
||||
this._renderHtml(this._jsonTpl(), false);
|
||||
|
||||
var val = this._data.val;
|
||||
|
||||
@@ -221,9 +222,9 @@ export default class Sources extends Tool
|
||||
{
|
||||
this._renderHtml(this._iframeTpl({src: this._data.val}));
|
||||
}
|
||||
_renderHtml(html)
|
||||
_renderHtml(html, cache = true)
|
||||
{
|
||||
if (html === this._lastHtml) return;
|
||||
if (cache && html === this._lastHtml) return;
|
||||
this._lastHtml = html;
|
||||
this._$el.html(html);
|
||||
// Need setTimeout to make it work
|
||||
|
||||
@@ -8,7 +8,7 @@ $font-size-s: 12px;
|
||||
$font-size-l: 16px;
|
||||
|
||||
$font-family: 'Helvetica Neue', Helvetica, Arial, sans-seri;
|
||||
$font-family-code: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
$font-family-code: Monaco, MonoSpace;
|
||||
|
||||
$anim-duration: .3s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user