Removed console logs and other debugging elements
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pau 2022-09-27 13:05:46 +02:00
parent d30065f90a
commit c2813e3633
1 changed files with 4 additions and 19 deletions

View File

@ -7,24 +7,13 @@ export default class inputAccount extends Field {
this.buildInput('text');
this.element.addEventListener('click', e => {
console.log(this.element);
console.log(e);
let targetElement = e.target;
console.log(targetElement);
let currentValue = targetElement.value;
let arrayValue = currentValue.split('');
console.log(arrayValue);
let pointer = 0;
targetElement.addEventListener('keyup', e => {
this.$.$applyAsync(async() =>
pointer = await insertFunction(e, targetElement, currentValue, arrayValue, pointer));
$scope.digest();
});
});
@ -35,18 +24,17 @@ export default class inputAccount extends Field {
} else if (e.key == 'ArrowRight') {
pointer != 10 ? pointer++ : pointer = 0;
return pointer;
} else if (e.key == 'ArrowUp' || e.key == 'ArrowDown') {
blur();
return 0;
}
console.log(e);
currentValue = targetElement.value;
arrayValue = currentValue.split('');
console.log(arrayValue);
let keyToInsert = e.key;
console.log(`Pointer => ${pointer}`);
console.log(`InputKey => ${keyToInsert}`);
if (keyToInsert.length > 1) return pointer;
arrayValue[pointer] = keyToInsert;
@ -55,12 +43,9 @@ export default class inputAccount extends Field {
if (pointer < 10) pointer++;
if (arrayValue.length > 10) {
console.log(`Demasiado largo --> ${arrayValue.length}`);
arrayValue = arrayValue.slice(0, 10);
console.log(`Se ha eliminado el ultimo elemento añadido --> ${arrayValue}`);
targetElement.value = arrayValue.join('');
}
console.log(targetElement.value);
return pointer;
}
}