Now considering depth on highlight nest

Made this chunk of code active by removing 1==2 condition.
Now also defining 3 events in a variable and applying to text section
and arrow start ends. Also needed cursor: pointer.
This commit is contained in:
Matt Pass
2013-03-16 10:42:26 +00:00
parent e656c89ba1
commit bf22cd1638

View File

@@ -309,7 +309,7 @@ var ICEcoder = {
cursor.findPrevious();
searchPos.ch = cursor.from().ch;
searchPos.line = cursor.from().line;
if (i==nestPos && 1==2) {
if (i==nestPos) {
cursorX = cM.getSearchCursor(">",searchPos);
cursorX.findNext();
searchPosX = new Object();
@@ -974,7 +974,7 @@ var ICEcoder = {
// Work out the nesting depth location on demand and update our display if required
getNestLocation: function(updateNestDisplay) {
var cM, nestCheck, state, cx, startPos, fileName;
var cM, nestCheck, state, cx, startPos, fileName, events;
cM = ICEcoder.getcMInstance();
nestCheck = cM.getValue();
@@ -1006,11 +1006,12 @@ var ICEcoder = {
// Then for all the array items, output as the nest display
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
if (i==0) {ICEcoder.nestDisplay.innerHTML += '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'};
ICEcoder.nestDisplay.innerHTML += '<a onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')" style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+ICEcoder.htmlTagArray[i]+'</a>';
events = 'onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')"';
if (i==0) {ICEcoder.nestDisplay.innerHTML += '<div '+events+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif)"></div>'};
ICEcoder.nestDisplay.innerHTML += '<a '+events+' style="display: inline-block; cursor: pointer; background: #333; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px">'+ICEcoder.htmlTagArray[i]+'</a>';
ICEcoder.nestDisplay.innerHTML += i<ICEcoder.htmlTagArray.length-1
? '<div style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0"></div>'
: '<div style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0"></div>';
? '<div '+events+' style="display: inline-block; width: 8px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -7px 0; cursor: pointer"></div>'
: '<div '+events+' style="display: inline-block; width: 7px; margin-top: -5px; height: 30px; background-image: url(images/nest-tag-bg.gif); background-position: -15px 0; cursor: pointer"></div>';
}
}
}