From 9f129c978130d3b3a5cbe9d352daf47b29fd91b2 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 8 Feb 2013 14:32:45 +0000 Subject: [PATCH] Tidying up recent changes re tabs tagDragMouseXStart should be tabDragMouseXStart Ensuring vars are defined at top of function & in usage order Forgot a var in the foor loop --- lib/ice-coder.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 3032e25..a1e6dd8 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1099,7 +1099,7 @@ var ICEcoder = { diffX = top.ICEcoder.mouseX - top.ICEcoder.diffStartX; if (top.ICEcoder.draggingTab!==false && top.ICEcoder.diffStartX && (diffX <= -10 || diffX >= 10)) { if (top.ICEcoder.mouseX > parseInt(top.ICEcoder.files.style.width,10)) { - top.ICEcoder.tabDragMouseX = top.ICEcoder.mouseX - parseInt(top.ICEcoder.files.style.width,10) - top.ICEcoder.tagDragMouseXStart; + top.ICEcoder.tabDragMouseX = top.ICEcoder.mouseX - parseInt(top.ICEcoder.files.style.width,10) - top.ICEcoder.tabDragMouseXStart; top.ICEcoder.tabDragMove(); } } @@ -1692,7 +1692,7 @@ var ICEcoder = { // Set the tabs width setTabWidths: function() { - var availWidth, avgWidth, lastLeft, lastWidth, tabWidth; + var availWidth, avgWidth, tabWidth, lastLeft, lastWidth; availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18; @@ -1716,7 +1716,7 @@ var ICEcoder = { tabDragStart: function(tab) { top.ICEcoder.draggingTab = tab; top.ICEcoder.diffStartX = top.ICEcoder.mouseX; - top.ICEcoder.tagDragMouseXStart = (top.ICEcoder.mouseX - (parseInt(top.ICEcoder.files.style.width,10)+41+18)) % 150; + top.ICEcoder.tabDragMouseXStart = (top.ICEcoder.mouseX - (parseInt(top.ICEcoder.files.style.width,10)+41+18)) % 150; top.document.getElementById('tab'+tab).style.zIndex = 2; for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { top.document.getElementById('tab'+i).className = i!==tab @@ -1727,7 +1727,7 @@ var ICEcoder = { // Tab dragging tabDragMove: function() { - var tabWidth, lastTabWidth; + var lastTabWidth, thisLeft, dragTabNo, tabWidth; lastTabWidth = parseInt(top.document.getElementById('tab'+top.ICEcoder.openFiles.length).style.width,10)+18; @@ -1757,7 +1757,7 @@ var ICEcoder = { // Tab dragging end tabDragEnd: function() { - var swapWith; + var swapWith, tempArray; top.ICEcoder.setTabWidths(); for (var i=1; i<=top.ICEcoder.openFiles.length; i++) { @@ -1775,7 +1775,7 @@ var ICEcoder = { } } if (top.ICEcoder.thisLeft && top.ICEcoder.thisLeft!==false) { - var tempArray = []; + tempArray = []; for (var i=1;i<=top.ICEcoder.openFiles.length;i++) { tempArray.push(i); } @@ -1790,7 +1790,7 @@ var ICEcoder = { // Sort tabs into new order sortTabs: function(newOrder) { - var changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = []; + var a, b, changedContent = [], openFiles = [], openFileMDTs = [], cMInstances = [], selectedTabWillBe; a = [ICEcoder.changedContent, ICEcoder.openFiles, ICEcoder.openFileMDTs, ICEcoder.cMInstances]; b = [changedContent, openFiles, openFileMDTs, cMInstances]; @@ -1836,7 +1836,7 @@ var ICEcoder = { nextValue = currentArray[0]; nextValueFull = currentArrayFull[0]; nextPos = 0; - for (i=0;i