diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-05-13 15:54:45 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-05-13 15:54:45 +0200 |
commit | 591b383f2dd1601009382152079e004034c4258d (patch) | |
tree | 3d5bf793840147817b81cd30f3c7a0cc39f18442 /core | |
parent | 665663432c63531341bb983e1e8d78dcd6a80db2 (diff) | |
download | nextcloud-server-591b383f2dd1601009382152079e004034c4258d.tar.gz nextcloud-server-591b383f2dd1601009382152079e004034c4258d.zip |
peselect filename without extension on rename
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index d85e6d88f8a..3cb4d3dd151 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -767,6 +767,26 @@ OC.set=function(name, value) { context[tail]=value; }; +/** + * select a range in an input field + * @link http://stackoverflow.com/questions/499126/jquery-set-cursor-position-in-text-area + * @param {type} start + * @param {type} end + */ +$.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(); + } + }); +}; /** * Calls the server periodically every 15 mins to ensure that session doesnt |