Skip to content

Commit

Permalink
0.5.1 close popups on click & fix modifier keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tobibeer committed Jan 14, 2016
1 parent 2e0f8cf commit a63a34c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion editions/preview/tiddlers/content/preview-Install.tid
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ type: text/vnd.tiddlywiki

!! Version History

; 0.5.0 / 2016-01-14
; 0.5.1 / 2016-01-14
: initial version
2 changes: 1 addition & 1 deletion plugins/tobibeer/preview/defaults.multids
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/plugins/tobibeer/preview/

lingo/keys: modifier keys to trigger popup directly on-hover (alt, ctrl, shift, meta)
lingo/keys: modifier keys to trigger popup directly on-hover (ctrl, alt+shift, meta, etc...)
defaults/keys: CTRL

lingo/delay: delay popup for this many milliseconds
Expand Down
2 changes: 1 addition & 1 deletion plugins/tobibeer/preview/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "$:/plugins/tobibeer/preview",
"description": "Shows a tiddler preview when hovering internal links",
"author": "Tobias Beer",
"version": "0.5.0",
"version": "0.5.1",
"core-version": ">=5.1.9",
"source": "https://github.com/tobibeer/tw5-preview",
"documentation": "https://tobibeer.github.io/tw5-preview",
Expand Down
1 change: 0 additions & 1 deletion plugins/tobibeer/preview/popup.tid
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tc-popup appear appear-block tc-preview-tiddler tc-preview-tiddler-$num$ $(defau
\define level(num)
<$reveal tag="div" type="popup" state=<<state $num$>> class=<<classes $num$>>>
<$tiddler tiddler={{$:/temp/tobibeer/preview-$num$-tiddler}}>

<$transclude tiddler={{$:/plugins/tobibeer/preview/defaults/template}} mode="block"/>
</$tiddler>
</$reveal>
Expand Down
2 changes: 1 addition & 1 deletion plugins/tobibeer/preview/startup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/defaults.multids
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: $:/plugins/tobibeer/preview/

lingo/keys: modifier keys to trigger popup directly on-hover (alt, ctrl, shift, meta)
lingo/keys: modifier keys to trigger popup directly on-hover (ctrl, alt+shift, meta, etc...)
defaults/keys: CTRL

lingo/delay: delay popup for this many milliseconds
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"title": "$:/plugins/tobibeer/preview",
"description": "Shows a tiddler preview when hovering internal links",
"author": "Tobias Beer",
"version": "0.5.0",
"version": "0.5.1",
"core-version": ">=5.1.9",
"source": "https://github.com/tobibeer/tw5-preview",
"documentation": "https://tobibeer.github.io/tw5-preview",
Expand Down
7 changes: 7 additions & 0 deletions src/startup.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ CoreLink.prototype.render = function() {
if(e === "mouseover") {
// Actually showing anything?
if(show()) {
// No keycode?
if(!ev.keyCode) {
// Set to 0, for whatever reason the core expects one
ev.keyCode = 0;
}
// Modifier keys say we show directly?
if($tw.utils.checkKeyDescriptor(ev,keys)) {
// Then show
Expand Down Expand Up @@ -154,6 +159,8 @@ CoreLink.prototype.handleClickEvent = function() {
clickCore.apply(this,arguments);
// Abort popup delay timeout
clearTimeout(this.delayTimeout);
// Close popups
$tw.popup.cancel(Math.max(0,$tw.popup.popupInfo(this).popupLevel-1));
};

// Hijack popupInfo() of core Popup ($tw.popup)
Expand Down

0 comments on commit a63a34c

Please sign in to comment.