diff --git a/README.md b/README.md index 2424e54..147b75c 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,6 @@ You can find all these commands by [`Command Palette`](http://flight-manual.atom ## Icon alphabet meaning -- `U` : Unknown - ##### HTML - `<>` : Element @@ -90,7 +88,11 @@ You can find all these commands by [`Command Palette`](http://flight-manual.atom - `I` : Import - `F` : Function - `M` : Method -- `V`: Variable +- `V` : Variable + +#### Others + +- `U` : Unknown diff --git a/lib/structure-view.js b/lib/structure-view.js index c41c8d2..c075c04 100644 --- a/lib/structure-view.js +++ b/lib/structure-view.js @@ -36,6 +36,11 @@ export default class StructureView { toggle: true }); }, + onSelectTreeNode(evt) { + Util.selectTreeNode($(evt.target), this, { + toggle: false + }); + } }, watch: { treeNodeId(val) { @@ -274,15 +279,14 @@ export default class StructureView { if (item.child) { let childContent = self.treeGenerator(item.child); - if (childContent.length != 0) - { - entry = `
  • -
    - ${iconTpl} - ${item.name} -
    -
      ${childContent}
    -
  • `; + if (childContent.length != 0) { + entry = `
  • +
    + ${iconTpl} + ${item.name} +
    +
      ${childContent}
    +
  • `; } } diff --git a/lib/util.js b/lib/util.js index 5df2ecb..c926b10 100644 --- a/lib/util.js +++ b/lib/util.js @@ -25,11 +25,16 @@ export default { if ($target.is('span')) $target = $target.parent(); if ($target.is('div')) $target = $target.parent(); if ($target.is('li')) { + // ".toggle" would be TRUE if it's double click if (opts && opts.toggle) { $target.hasClass('list-nested-item') && $target[$target.hasClass('collapsed') ? 'removeClass' : 'addClass']('collapsed'); } let oldVal = vm.treeNodeId, val = $target.attr('node-id'); + + // Same node + if (oldVal === val) return; + oldVal && $('div.structure-view>div.tree-panel>ol').find('li.selected').removeClass('selected'); $target.addClass('selected'); vm.treeNodeId = val; diff --git a/styles/structure-view.less b/styles/structure-view.less index 813bd2b..aca5307 100644 --- a/styles/structure-view.less +++ b/styles/structure-view.less @@ -27,6 +27,10 @@ margin-right: 2px; } + .full-menu { + user-select: none; + } + div.symbol-mixed-block { display: flex; align-items: center; diff --git a/templates/structure-view.html b/templates/structure-view.html index fd99514..4ab03aa 100644 --- a/templates/structure-view.html +++ b/templates/structure-view.html @@ -1,7 +1,7 @@
    {{noTagHint}}
    -
      +