diff options
Diffstat (limited to 'js/dict.js')
-rw-r--r-- | js/dict.js | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -1,12 +1,13 @@ -$(window).on("mouseup touchend", function() { - if (!navigator.onLine) return; +$(document).ready(function() { + $(window).on("mouseup touchend", function() { + if (!navigator.onLine) return; - var sel = getSelection().toString().trim(); + var sel = getSelection().toString().trim(); - if (sel.match(/^\w+$/)) { - parent.dict_lookup(sel, function() { - getSelection().removeAllRanges(); - }); - } + if (sel.match(/^\w+$/)) { + parent.dict_lookup(sel, function() { + getSelection().removeAllRanges(); + }); + } + }); }); - |