|
@@ -54,8 +54,6 @@ let currentSlide = 0
|
|
function truncateFraction (number) {
|
|
function truncateFraction (number) {
|
|
try {
|
|
try {
|
|
let strNum = String(number).split('.')
|
|
let strNum = String(number).split('.')
|
|
- console.log(strNum)
|
|
|
|
- console.log(strNum[1].length)
|
|
|
|
if(strNum[1].length > 3) {
|
|
if(strNum[1].length > 3) {
|
|
strNum[1] = strNum[1].slice(0, 3)
|
|
strNum[1] = strNum[1].slice(0, 3)
|
|
}
|
|
}
|
|
@@ -75,7 +73,6 @@ function isValidInput (value) {
|
|
|
|
|
|
function invokeError(bool, element, dependent) {
|
|
function invokeError(bool, element, dependent) {
|
|
try {
|
|
try {
|
|
- console.log(bool)
|
|
|
|
if(bool) {
|
|
if(bool) {
|
|
if(element.getElementsByTagName('small')[0]) {
|
|
if(element.getElementsByTagName('small')[0]) {
|
|
element.getElementsByTagName('small')[0].remove()
|
|
element.getElementsByTagName('small')[0].remove()
|
|
@@ -108,16 +105,15 @@ container.addEventListener('input', (e) => {
|
|
})
|
|
})
|
|
|
|
|
|
reader.addEventListener('click', (e) => {
|
|
reader.addEventListener('click', (e) => {
|
|
- console.log(e.target.id)
|
|
|
|
switch(e.target.id) {
|
|
switch(e.target.id) {
|
|
case 'goleft':
|
|
case 'goleft':
|
|
if(currentSlide <= 0) {
|
|
if(currentSlide <= 0) {
|
|
currentSlide = texts.length - 1
|
|
currentSlide = texts.length - 1
|
|
- console.log(currentSlide)
|
|
|
|
} else {
|
|
} else {
|
|
currentSlide--
|
|
currentSlide--
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+
|
|
case 'goright':
|
|
case 'goright':
|
|
if(currentSlide >= texts.length - 1) {
|
|
if(currentSlide >= texts.length - 1) {
|
|
currentSlide = 0
|
|
currentSlide = 0
|
|
@@ -126,7 +122,6 @@ reader.addEventListener('click', (e) => {
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- console.log(e.currentTarget)
|
|
|
|
reader.getElementsByTagName('h2')[0].innerHTML = texts[currentSlide].title
|
|
reader.getElementsByTagName('h2')[0].innerHTML = texts[currentSlide].title
|
|
reader.getElementsByTagName('p')[0].innerHTML = texts[currentSlide].text
|
|
reader.getElementsByTagName('p')[0].innerHTML = texts[currentSlide].text
|
|
reader.getElementsByTagName('p')[1].remove()
|
|
reader.getElementsByTagName('p')[1].remove()
|