Skip to content

Commit ffc8eb1

Browse files
committed
Style changes and updating comment block
1 parent e77c14d commit ffc8eb1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

jquery-textrange.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
/**
22
* jquery-textrange
33
* A jQuery plugin for getting, setting and replacing the selected text in input fields and textareas.
4-
* See the [wiki](https://github.com/dwieeb/jquery-textrange/wiki) for usage and examples.
4+
* See the [README](https://github.com/dwieeb/jquery-textrange/blob/1.x/README.md) for usage and examples.
55
*
66
* (c) 2012-2014 Daniel Imhoff <dwieeb@gmail.com> - danielimhoff.com
77
*/
8+
89
(function(factory) {
10+
911
if (typeof define === 'function' && define.amd) {
1012
define(['jquery'], factory);
11-
} else if (typeof exports === 'object') {
13+
}
14+
else if (typeof exports === 'object') {
1215
factory(require('jquery'));
13-
} else {
16+
}
17+
else {
1418
factory(jQuery);
1519
}
20+
1621
})(function($) {
1722

1823
var browserType,
@@ -197,12 +202,7 @@
197202
return this;
198203
}
199204

200-
// Prevents unpleasant behaviour for textareas in IE:
201-
// If you have a textarea which is too wide to be displayed entirely and therfore has to be scrolled horizontally,
202-
// then typing one character after another will scroll the page automatically to the right at the moment you reach
203-
// the right border of the visible part. But calling the focus function causes the page to be scrolled to the left
204-
// edge of the textarea. Immediately after that jump to the left side, the content is scrolled back to the cursor
205-
// position, which leads to a flicker page every time you type a character.
205+
// Focus on the element before operating upon it.
206206
if (document.activeElement !== this[0]) {
207207
this[0].focus();
208208
}

0 commit comments

Comments
 (0)