aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/scripts3.js')
-rw-r--r--web/scripts3.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/web/scripts3.js b/web/scripts3.js
index f4a21da3..e1cc5952 100644
--- a/web/scripts3.js
+++ b/web/scripts3.js
@@ -108,17 +108,15 @@ function checkUsername() {
/******************************************************************************/
jQuery.fn.selectText = function(){
- var doc = document;
- var element = this[0];
- console.log(this, element);
- if (doc.body.createTextRange) {
- var range = document.body.createTextRange();
- range.moveToElementText(element);
+ var d = document;
+ if (d.body.createTextRange) {
+ var range = d.body.createTextRange();
+ range.moveToElementText(this[0]);
range.select();
} else if (window.getSelection) {
var selection = window.getSelection();
- var range = document.createRange();
- range.selectNodeContents(element);
+ var range = d.createRange();
+ range.selectNodeContents(this[0]);
selection.removeAllRanges();
selection.addRange(range);
}