diff --git a/.gitignore b/.gitignore index 9751307ac..34122ecff 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ tmp-crx/ tmp-userjs/ tmp-userscript/ builds/4chan-X.zip -Gruntfile.js \ No newline at end of file +Gruntfile.js +4chan-x* diff --git a/LICENSE b/LICENSE index 0c6869161..4504d144d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.0.0 - 2013-05-03 +* appchan x - Version 2.0.0 - 2013-05-05 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE diff --git a/builds/appchan-x.js b/builds/appchan-x.js index f268e3f09..c0f2fac26 100644 --- a/builds/appchan-x.js +++ b/builds/appchan-x.js @@ -19,7 +19,7 @@ // ==/UserScript== /* -* appchan x - Version 2.0.0 - 2013-05-03 +* appchan x - Version 2.0.0 - 2013-05-05 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -4741,6 +4741,7 @@ } }); $.on(root, endEvents, o.hoverend); + $.on(d, 'keydown', o.hoverend); return $.on(root, 'mousemove', o.hover); }; hover = function(e) { @@ -4757,9 +4758,13 @@ style.left = left; return style.right = right; }; - hoverend = function() { + hoverend = function(e) { + if (e.type === 'keydown' && e.keyCode !== 13) { + return; + } $.rm(this.el); $.off(this.root, this.endEvents, this.hoverend); + $.off(d, 'keydown', this.hoverend); $.off(this.root, 'mousemove', this.hover); if (this.cb) { return this.cb.call(this); diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index d9f15c211..35dfb2f9d 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -19,7 +19,7 @@ // ==/UserScript== /* -* appchan x - Version 2.0.0 - 2013-05-03 +* appchan x - Version 2.0.0 - 2013-05-05 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -4737,6 +4737,7 @@ } }); $.on(root, endEvents, o.hoverend); + $.on(d, 'keydown', o.hoverend); return $.on(root, 'mousemove', o.hover); }; hover = function(e) { @@ -4753,9 +4754,13 @@ style.left = left; return style.right = right; }; - hoverend = function() { + hoverend = function(e) { + if (e.type === 'keydown' && e.keyCode !== 13) { + return; + } $.rm(this.el); $.off(this.root, this.endEvents, this.hoverend); + $.off(d, 'keydown', this.hoverend); $.off(this.root, 'mousemove', this.hover); if (this.cb) { return this.cb.call(this); diff --git a/builds/crx/script.js b/builds/crx/script.js index 5f7fdedb6..56cd1c4cd 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.0.0 - 2013-05-03 +* appchan x - Version 2.0.0 - 2013-05-05 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -4738,6 +4738,7 @@ } }); $.on(root, endEvents, o.hoverend); + $.on(d, 'keydown', o.hoverend); return $.on(root, 'mousemove', o.hover); }; hover = function(e) { @@ -4754,9 +4755,13 @@ style.left = left; return style.right = right; }; - hoverend = function() { + hoverend = function(e) { + if (e.type === 'keydown' && e.keyCode !== 13) { + return; + } $.rm(this.el); $.off(this.root, this.endEvents, this.hoverend); + $.off(d, 'keydown', this.hoverend); $.off(this.root, 'mousemove', this.hover); if (this.cb) { return this.cb.call(this); diff --git a/src/General/UI.coffee b/src/General/UI.coffee index 17f005e0b..e4d134d2c 100644 --- a/src/General/UI.coffee +++ b/src/General/UI.coffee @@ -323,6 +323,7 @@ UI = do -> o.hover o.latestEvent if el.parentNode $.on root, endEvents, o.hoverend + $.on d, 'keydown', o.hoverend $.on root, 'mousemove', o.hover hover = (e) -> @@ -348,9 +349,11 @@ UI = do -> style.left = left style.right = right - hoverend = -> + hoverend = (e) -> + return if e.type is 'keydown' and e.keyCode isnt 13 $.rm @el $.off @root, @endEvents, @hoverend + $.off d, 'keydown', @hoverend $.off @root, 'mousemove', @hover @cb.call @ if @cb