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
This commit is contained in:
Matt Pass
2013-02-08 14:32:45 +00:00
parent 18931e94b0
commit 9f129c9781

View File

@@ -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<currentArray.length;i++) {
for (var i=0;i<currentArray.length;i++) {
if (currentArray[i] < nextValue) {
nextValue = currentArray[i];
nextValueFull = top.ICEcoder.openFiles[top.ICEcoder.openFiles.indexOf(currentArrayFull[i])];