diff --git a/lib/coder.js b/lib/coder.js index d495acc..d7135f0 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -24,6 +24,7 @@ var ICEcoder = { stickyTabWindow: false, // Target variable for the sticky tab window pluginIntervalRefs: [], // Array of plugin interval refs dragSrcEl: null, // Tab element being dragged + ready: false, // Indicates if ICEcoder is ready for action // Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks tagNestExceptions: ["!DOCTYPE","meta","link","img","br","hr","input","script","?php","?","%"], @@ -63,6 +64,7 @@ var ICEcoder = { tab.addEventListener('drop', ICEcoder.handleDrop, false); tab.addEventListener('dragend', ICEcoder.handleDragEnd, false); }); + top.ICEcoder.ready = true; }, // Set our layout according to the browser size @@ -1155,13 +1157,15 @@ var ICEcoder = { dragCursorTest: function() { var winH; - window.innerWidth ? winH = window.innerHeight : winH = document.body.clientHeight; - if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false}; + if (top.ICEcoder.ready) { + window.innerWidth ? winH = window.innerHeight : winH = document.body.clientHeight; + if (!top.ICEcoder.mouseDown) {top.ICEcoder.draggingFilesW = false}; - if ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW) { - top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "w-resize"; - } else { - top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "auto"; + if ((top.ICEcoder.mouseX > top.ICEcoder.filesW-7 && top.ICEcoder.mouseX < top.ICEcoder.filesW+7 && top.ICEcoder.mouseY > 40 && top.ICEcoder.mouseY < (winH-30)) || top.ICEcoder.draggingFilesW) { + top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "w-resize"; + } else { + top.document.body.style.cursor = top.ICEcoder.content.contentWindow.document.body.style.cursor = top.ICEcoder.filesFrame.contentWindow.document.body.style.cursor = "auto"; + } } },