summaryrefslogtreecommitdiff
path: root/js/dict.js
blob: f8336d2d647d94f19d3334bfe55a31d955b505e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict';

$(document).ready(function() {
	$(window).on("mouseup touchend", function() {
		if (!navigator.onLine) return;

		const sel = getSelection().toString().trim();

		if (sel.match(/^\w+$/)) {
			parent.Reader.lookupWord(sel, function() {
				getSelection().removeAllRanges();
			});
		}
	});
});