diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-06-19 01:13:35 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-06-19 01:13:35 +0300 |
commit | 4071f52223c146a97758ad6723d1f1353df5eade (patch) | |
tree | db162c9ee45b40fbd61bff62ff6f09059a3e482e | |
parent | 41c48b423e669adb4a40bda45b5c5b9317118e19 (diff) |
Remove useless params of Functions.selectContent
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r-- | js/src/functions.js | 19 | ||||
-rw-r--r-- | js/src/sql.js | 5 |
2 files changed, 10 insertions, 14 deletions
diff --git a/js/src/functions.js b/js/src/functions.js index 12331589a8..e66a6a9428 100644 --- a/js/src/functions.js +++ b/js/src/functions.js @@ -15,15 +15,14 @@ var Functions = {}; /** - * @var sqlBoxLocked lock for the sqlbox textarea in the querybox + * @type {boolean} lock for the sqlbox textarea in the querybox */ -// eslint-disable-next-line no-unused-vars -var sqlBoxLocked = false; +let sqlBoxLocked = false; /** - * @var {array}, holds elements which content should only selected once + * @type {boolean[]} holds elements which content should only selected once */ -var onlyOnceElements = []; +const onlyOnceElements = []; /** * @var {number} ajaxMessageCount Number of AJAX messages shown since page load @@ -632,18 +631,16 @@ Functions.displayPasswordGenerateButton = function () { /** * selects the content of a given object, f.e. a textarea * - * @param {object} element element of which the content will be selected - * @param {any | true} lock variable which holds the lock for this element or true, if no lock exists - * @param {boolean} onlyOnce boolean if true this is only done once f.e. only on first focus + * @param {HTMLTextAreaElement} element Element of which the content will be selected */ -Functions.selectContent = function (element, lock, onlyOnce) { - if (onlyOnce && onlyOnceElements[element.name]) { +Functions.selectContent = function (element) { + if (onlyOnceElements[element.name]) { return; } onlyOnceElements[element.name] = true; - if (lock) { + if (sqlBoxLocked) { return; } diff --git a/js/src/sql.js b/js/src/sql.js index 7b109f07cd..cf99236455 100644 --- a/js/src/sql.js +++ b/js/src/sql.js @@ -10,7 +10,6 @@ /* global isStorageSupported */ // js/config.js /* global codeMirrorEditor */ // js/functions.js /* global makeGrid */ // js/makegrid.js -/* global sqlBoxLocked */ // js/functions.js var Sql = {}; @@ -844,12 +843,12 @@ AJAX.registerOnload('sql.js', function () { }); $('#view_as').on('click', function () { - Functions.selectContent(this, sqlBoxLocked, true); + Functions.selectContent(this); }); $('#sqlquery').on('click', function () { if ($(this).data('textarea-auto-select') === true) { - Functions.selectContent(this, sqlBoxLocked, true); + Functions.selectContent(this); } }); }); // end $() |