reorganizing things in js

1.0
saleiva 14 years ago
parent d027d0591d
commit 986035ab97

@ -957,21 +957,7 @@
});
//AUXILIAR FUNCTION FOR SELECTING A RANGE OF TEXT IN A TEXT AREA
$.fn.selectRange = function(start, end) {
return this.each(function() {
if(this.setSelectionRange) {
this.focus();
this.setSelectionRange(start, end);
} else if(this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
});
};
///////////////////////////////////////
// SIMPLE CLICK -> Open editor //

@ -113,3 +113,22 @@
ev.preventDefault();
ev.stopPropagation();
}
/*============================================================================*/
/* Select a text range into within a textArea */
/*============================================================================*/
$.fn.selectRange = function(start, end) {
return this.each(function() {
if(this.setSelectionRange) {
this.focus();
this.setSelectionRange(start, end);
} else if(this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
});
};

Loading…
Cancel
Save