From 929cb900dc7b6b0ea0df3e888f18ddb3ec0527f1 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 1 Dec 2015 15:31:12 +0100 Subject: * balloon with context switch link --- main.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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, ',
')); + balloon.append($('

').text(candidateNode.data.name)); + if (!candidateNode.data.main) { + var switchLink = $('').attr({ + 'href': '#', + 'data-link': candidateNode.name + }); + switchLink.text('[go!]'); + switchLink.click(switchContext); + balloon.append(switchLink); + } balloon.hide(); $('body').append(balloon); balloon.data('node', candidateNode); -- cgit v1.2.3