fixes #820
This commit is contained in:
@@ -73,4 +73,24 @@
|
||||
});
|
||||
return filtered;
|
||||
}
|
||||
|
||||
$.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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.selectEnd = function(){
|
||||
this.selectRange(this.val().length, this.val().length);
|
||||
return this;
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user