// var letters = angular.element(childrenElement.querySelectorAll('.small')); /** * writingAnimation() */ function writingAnimation() { var i = 0; var textTimeout; /** * addText() * */ (function addText() { if (letters[i]) { letters[i].classList.add('is-big'); } i++; // the text animation shall take max 20s var isInTime = Math.round( ( i * 67 ) / 1000 ) <= 20; if (isInTime && totalLength >= i) { if (angular.isDefined(textTimeout)) { $timeout.cancel(textTimeout); } textTimeout = $timeout(addText, 1000 / 30 ); } else { if (!isInTime) { childrenElement.querySelector('.description').innerHTML += '...'; // Leguan } if (settings.QRMode === 2) { currentItem.iconStyle['opacity'] = '0'; } } })(); }