|
@@ -3,15 +3,6 @@ $('body').append(linkAddress);
|
|
// 'Hidden' yet selectable
|
|
// 'Hidden' yet selectable
|
|
linkAddress.css({position: 'absolute', left:'-9999em'});
|
|
linkAddress.css({position: 'absolute', left:'-9999em'});
|
|
|
|
|
|
-function clearLinkAddress() {
|
|
|
|
- if (linkAddress.val()) {
|
|
|
|
- linkAddress.val(null);
|
|
|
|
- console.log("Cleared linkAddress");
|
|
|
|
- window.getSelection().removeAllRanges();
|
|
|
|
- }
|
|
|
|
- console.log("Current selection: " + window.getSelection().toString());
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
$(function() {
|
|
$(function() {
|
|
$('a').on({
|
|
$('a').on({
|
|
mouseenter: function() {
|
|
mouseenter: function() {
|
|
@@ -27,9 +18,12 @@ $(function() {
|
|
},
|
|
},
|
|
mouseleave: function() {
|
|
mouseleave: function() {
|
|
console.log("Leaving link.");
|
|
console.log("Leaving link.");
|
|
- clearLinkAddress();
|
|
|
|
|
|
+ if (linkAddress.val()) {
|
|
|
|
+ linkAddress.val(null);
|
|
|
|
+ console.log("Cleared linkAddress");
|
|
|
|
+ window.getSelection().removeAllRanges();
|
|
|
|
+ }
|
|
|
|
+ console.log("Current selection: " + window.getSelection().toString());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
- window.onbeforeunload = clearLinkAddress();
|
|
|
|
});
|
|
});
|