Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Show/hide text next to nest display
Browse files Browse the repository at this point in the history
New array item for nestDisplayText
Clear this to begin with then set with text if we have a nest, clear
otherwise
Only show the cursor position item if we have a nest
  • Loading branch information
mattpass committed Mar 17, 2013
1 parent e2adcab commit 33ea31f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ice-coder.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var ICEcoder = {

// Set our aliases
initAliases: function() {
var aliasArray = ["header","files","account","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"];
var aliasArray = ["header","files","account","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplayText","nestDisplay","charDisplay"];

// Create our ID aliases
for (var i=0;i<aliasArray.length;i++) {
Expand Down Expand Up @@ -1028,13 +1028,15 @@ var ICEcoder = {
// Now we've built up our nest depth array, if we're due to show it in the display
if (updateNestDisplay && !top.ICEcoder.dontUpdateNest) {
// Clear the display
ICEcoder.nestDisplayText.innerHTML = "";
ICEcoder.nestDisplay.innerHTML = "";
if ("undefined" != typeof ICEcoder.openFiles[ICEcoder.selectedTab-1]) {
fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1];
if (["js","coffee","rb","css","less"].indexOf(fileName.split(".")[1])<0 &&
(nestCheck.indexOf("include(")==-1)&&(nestCheck.indexOf("include_once(")==-1)&&
(nestCheck.indexOf("<html")>-1||nestCheck.indexOf("<body")>-1)) {

ICEcoder.nestDisplayText.innerHTML = ICEcoder.htmlTagArray.length > 0 ? "Cursor Position" : "";
// Then for all the array items, output as the nest display
for (var i=0;i<ICEcoder.htmlTagArray.length;i++) {
events = 'onMouseover="top.ICEcoder.highlightBlock('+i+')" onMouseout="top.ICEcoder.highlightBlock('+i+',\'hide\')" onClick="top.ICEcoder.setPosition('+i+',top.ICEcoder.startPosLine,\''+ICEcoder.htmlTagArray[i]+'\')"';
Expand All @@ -1044,7 +1046,7 @@ var ICEcoder = {
? '<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>';
}
if ("undefined" != typeof state.curState) {
if ("undefined" != typeof state.curState && ICEcoder.htmlTagArray.length > 0) {
ICEcoder.nestDisplay.innerHTML += '<a style="display: inline-block; cursor: default; padding: 7px 2px 7px 7px; margin-top: -5px; height: 30px; color: #666">'+(state.curState.tagName ? state.curState.tagName : 'content')+'</a>';
}
}
Expand Down

0 comments on commit 33ea31f

Please sign in to comment.