From 62e9611222bdc707e4661ad906a6a1fe94de9c9d Mon Sep 17 00:00:00 2001 From: Lutz Roeder Date: Sun, 23 Jun 2024 08:33:44 -0700 Subject: [PATCH] Update view.js (#1285) --- source/index.html | 2 +- source/view.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/index.html b/source/index.html index 3373cf0991..e9d68669bb 100644 --- a/source/index.html +++ b/source/index.html @@ -210,7 +210,7 @@ .sidebar-item-value-line-content { white-space: pre; word-wrap: normal; overflow: auto; display: block; } .sidebar-item-value-expander { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; float: right; color: #aaa; cursor: pointer; user-select: none; -webkit-user-select: none; -moz-user-select: none; padding: 4px 6px 4px 4px; } .sidebar-item-value-expander:hover { color: #333; } -.sidebar-item-value-button { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; float: right; color: #aaa; cursor: pointer; user-select: none; -webkit-user-select: none; -moz-user-select: none; padding: 0 0 0 3px; } +.sidebar-item-value-button { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; float: right; color: #aaa; cursor: pointer; user-select: none; -webkit-user-select: none; -moz-user-select: none; padding: 0 3px 0 3px; } .sidebar-item-value-button svg use { fill: #aaa; stroke: #aaa; } .sidebar-item-value-button:hover svg use { fill: #333; stroke: #333; } .sidebar-item-select { diff --git a/source/view.js b/source/view.js index 37cfad3feb..30a66d780b 100644 --- a/source/view.js +++ b/source/view.js @@ -3177,7 +3177,7 @@ view.NodeView = class extends view.Control { element.innerHTML = `name: ${name}`; element.addEventListener('pointerenter', () => this.emit('focus', this._node)); element.addEventListener('pointerleave', () => this.emit('blur', this._node)); - element.addEventListener('click', () => this.emit('select', this._node)); + element.addEventListener('click', () => this.emit('activate', this._node)); element.style.cursor = 'pointer'; this._element.appendChild(element); } else { @@ -3609,9 +3609,11 @@ view.FindSidebar = class extends view.Control { } _term(value) { - return this._exact ? - value === this._terms[0] : - this._terms.every((term) => value && value.toLowerCase().indexOf(term) !== -1); + if (this._exact) { + return value === this._terms[0]; + } + value = value.toLowerCase(); + return this._terms.every((term) => value.indexOf(term) !== -1); } _value(value) {