Commit b139c8db authored by ninabreznik's avatar ninabreznik Committed by yann300

Update _highlightExpressions and contextView.js

parent 80be8091
...@@ -29,8 +29,6 @@ var css = csjs` ...@@ -29,8 +29,6 @@ var css = csjs`
} }
.name { .name {
font-weight : bold; font-weight : bold;
margin-right : 15px;
cursor : pointer;
} }
.jump { .jump {
cursor : pointer; cursor : pointer;
...@@ -42,6 +40,7 @@ var css = csjs` ...@@ -42,6 +40,7 @@ var css = csjs`
} }
.referencesnb { .referencesnb {
float : right; float : right;
margin-left : 15px;
} }
` `
...@@ -133,17 +132,10 @@ class ContextView { ...@@ -133,17 +132,10 @@ class ContextView {
function next () { function next () {
var nodes = self._api.contextualListener.getActiveHighlights() var nodes = self._api.contextualListener.getActiveHighlights()
var currentName = node.attributes.name var currentName = node.attributes.name
var position = self.sourceMappingDecoder.decode(node.src)
if (currentName !== self.refName) self.ref = 0 if (currentName !== self.refName) self.ref = 0
var k = self.ref var k = self.ref
/// LOGS ///
nodes.forEach(node => console.log(node.position.start))
console.log('----')
console.log(k)
console.log('----')
var pos = nodes[k].position var pos = nodes[k].position
self._api.jumpTo(pos) self._api.jumpTo(pos)
...@@ -158,12 +150,6 @@ class ContextView { ...@@ -158,12 +150,6 @@ class ContextView {
var k = nodes.length - 1 - self.ref var k = nodes.length - 1 - self.ref
/// LOGS ///
nodes.forEach(node => console.log(node.position.start))
console.log('----')
console.log(k)
console.log('----')
var pos = nodes[k].position var pos = nodes[k].position
self._api.jumpTo(pos) self._api.jumpTo(pos)
...@@ -172,9 +158,9 @@ class ContextView { ...@@ -172,9 +158,9 @@ class ContextView {
} }
return yo`<div class=${css.line}> return yo`<div class=${css.line}>
<i class="fa fa-share ${css.jump}" aria-hidden="true" onclick=${jumpTo}></i>
<div title=${type} class=${css.type}>${type}</div> <div title=${type} class=${css.type}>${type}</div>
<div title=${node.attributes.name} class=${css.name}>${node.attributes.name}</div> <div title=${node.attributes.name} class=${css.name}>${node.attributes.name}</div>
<i class="fa fa-share ${css.jump}" aria-hidden="true" onclick=${jumpTo}></i>
<span class=${css.referencesnb}>${references}</span> <span class=${css.referencesnb}>${references}</span>
<i class="fa fa-chevron-up ${css.jump}" aria-hidden="true" onclick=${previous}></i> <i class="fa fa-chevron-up ${css.jump}" aria-hidden="true" onclick=${previous}></i>
<i class="fa fa-chevron-down ${css.jump}" aria-hidden="true" onclick=${next}></i> <i class="fa fa-chevron-down ${css.jump}" aria-hidden="true" onclick=${next}></i>
......
...@@ -120,6 +120,7 @@ class ContextualListener { ...@@ -120,6 +120,7 @@ class ContextualListener {
this._highlight(current, compilationResult) this._highlight(current, compilationResult)
} else { } else {
highlights(node.id) highlights(node.id)
this._highlight(node, compilationResult)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment