summaryrefslogtreecommitdiff
path: root/main.js
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2015-12-01 15:31:12 +0100
committeremkael <emkael@tlen.pl>2015-12-01 15:31:12 +0100
commit929cb900dc7b6b0ea0df3e888f18ddb3ec0527f1 (patch)
treee0b4604e64823e030f93bf5f54f7de845411ea7c /main.js
parent18f41d446b35844bbaa8788ab83fd271ca2e46fe (diff)
* balloon with context switch linkHEADmaster
Diffstat (limited to 'main.js')
-rw-r--r--main.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.js b/main.js
index 74d3bd4..a8dcdde 100644
--- a/main.js
+++ b/main.js
@@ -432,7 +432,16 @@
'border': 'solid 2px white',
'border-radius': '5px'
});
- balloon.append(JSON.stringify(candidateNode).replace(/,/g, ',<br />'));
+ balloon.append($('<h1>').text(candidateNode.data.name));
+ if (!candidateNode.data.main) {
+ var switchLink = $('<a>').attr({
+ 'href': '#',
+ 'data-link': candidateNode.name
+ });
+ switchLink.text('[go!]');
+ switchLink.click(switchContext);
+ balloon.append(switchLink);
+ }
balloon.hide();
$('body').append(balloon);
balloon.data('node', candidateNode);