From 2dc702efc67f8274c7a86235cf821c71bed9b886 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 11 Jul 2013 09:50:41 +0100 Subject: [PATCH] Animate folders & files into view Shows a new folder/file every 4ms to give the impression of animating into view --- lib/get-branch.php | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/get-branch.php b/lib/get-branch.php index 5b1dded..0afbed6 100644 --- a/lib/get-branch.php +++ b/lib/get-branch.php @@ -64,9 +64,28 @@ if (isset($_GET['location'])) { x = locNest.nextSibling; x.parentNode.removeChild(x); } - newUL.innerHTML = document.getElementById('branch').innerHTML.slice(28).slice(0,-7); - locNest.parentNode.insertBefore(newUL,locNest.nextSibling); - top.ICEcoder.redoTabHighlight(top.ICEcoder.selectedTab); + folderContent = document.getElementById('branch').innerHTML; + if (folderContent.indexOf('-1 || folderContent.indexOf('-1) { + // Now animate folders & files into view + i=0; + animFolders = setInterval(function() { + i++; + showContent = ""; + folderItems = folderContent.split("\n"); + for (j=0; j<=i; j++) { + showContent += folderItems[j]; + if (j