Jaap Marcus 2 лет назад
Родитель
Сommit
7ea3cb98b4
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      web/js/src/autoTrimInputs.js
  2. 2 2
      web/js/src/index.js

+ 1 - 1
web/js/src/trimInput.js → web/js/src/autoTrimInputs.js

@@ -1,5 +1,5 @@
 //trim leading / trailing spaces form input fields
-export default function trimInput() {
+export default function handleAutoTrimInputs() {
 	document.querySelectorAll('input[type="text"]').forEach((input) => {
 		input.addEventListener('change', function () {
 			this.value = this.value.trim();

+ 2 - 2
web/js/src/index.js

@@ -1,6 +1,7 @@
 import alpineInit from './alpineInit';
 import focusFirstInput from './focusFirstInput';
 import handleAddIpLists from './addIpLists';
+import handleAutoTrimInputs from './autoTrimInputs';
 import handleConfirmAction from './confirmAction';
 import handleCopyCreds from './copyCreds';
 import handleClipboardCopy from './clipboardCopy';
@@ -24,7 +25,6 @@ import handleStickyToolbar from './stickyToolbar';
 import handleSyncEmailValues from './syncEmailValues';
 import handleTabPanels from './tabPanels';
 import handleToggleAdvanced from './toggleAdvanced';
-import trimInput from './trimInput';
 import handleUnlimitedInput from './unlimitedInput';
 import initRrdCharts from './rrdCharts';
 import initWebTerminal from './webTerminal';
@@ -34,6 +34,7 @@ focusFirstInput();
 
 function initListeners() {
 	handleAddIpLists();
+	handleAutoTrimInputs();
 	handleConfirmAction();
 	handleCopyCreds();
 	handleClipboardCopy();
@@ -52,7 +53,6 @@ function initListeners() {
 	handleSyncEmailValues();
 	handleTabPanels();
 	handleToggleAdvanced();
-	trimInput();
 	initRrdCharts();
 	initWebTerminal();
 }