aboutsummaryrefslogtreecommitdiff
path: root/web/scripts3.js
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-04-14 06:38:03 +0700
committerGravatar Ugnich Anton2013-04-14 06:38:03 +0700
commit3692155bcddc13886bbbc0fd89bb4a4e3a24c88d (patch)
tree814753be28a156559d38d09c5f9b3e0fab832f47 /web/scripts3.js
parent29150ebc65d0d4cf90da3f437999395a86609504 (diff)
HTML/CSS optimization
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);
}