File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 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 ,
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 }
You can’t perform that action at this time.
0 commit comments