aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/jquery/selectrange.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-09-25 18:19:42 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-10-01 17:16:09 +0200
commitb9bc2417e7a8dc81feb0abe20359bedaf864f790 (patch)
tree61b47fbf37c1d168da8625224debde9e6a985348 /core/src/jquery/selectrange.js
parent7fb651235128dcbca8a6683b5cdafdf835f46300 (diff)
downloadnextcloud-server-b9bc2417e7a8dc81feb0abe20359bedaf864f790.tar.gz
nextcloud-server-b9bc2417e7a8dc81feb0abe20359bedaf864f790.zip
Comply to eslint
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/src/jquery/selectrange.js')
-rw-r--r--core/src/jquery/selectrange.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/core/src/jquery/selectrange.js b/core/src/jquery/selectrange.js
index b7e20361805..b53bac4fc02 100644
--- a/core/src/jquery/selectrange.js
+++ b/core/src/jquery/selectrange.js
@@ -1,4 +1,4 @@
-/*
+/**
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*
* @author 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
@@ -24,20 +24,21 @@ import $ from 'jquery'
/**
* 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
+ * @param {int} start start selection from
+ * @param {int} end number of char from start
+ * @returns {Void}
*/
-$.fn.selectRange = function (start, end) {
- return this.each(function () {
+$.fn.selectRange = function(start, end) {
+ return this.each(function() {
if (this.setSelectionRange) {
- this.focus();
- this.setSelectionRange(start, end);
+ 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();
+ var range = this.createTextRange()
+ range.collapse(true)
+ range.moveEnd('character', end)
+ range.moveStart('character', start)
+ range.select()
}
- });
-};
+ })
+}