Set the activeLineBG colour on theme choice

#ccc for light BG themes, #000 for dark themes
This commit is contained in:
Matt Pass
2012-08-05 15:24:08 +01:00
parent 20bd4d81ec
commit f69edba862

View File

@@ -1593,7 +1593,7 @@ var ICEcoder = {
// Update the settings used when we make a change to them
useNewSettings: function(themeURL,tabsIndent,codeAssist,lockedNav,visibleTabs,tabWidth,refreshFM) {
var styleNode, strCSS, cMCSS;
var styleNode, strCSS, cMCSS, activeLineBG;
// Add new stylesheet for selected theme
top.theme = themeURL.slice(themeURL.lastIndexOf("/")+1,themeURL.lastIndexOf("."));
@@ -1603,6 +1603,7 @@ var ICEcoder = {
styleNode.setAttribute('type', 'text/css');
styleNode.setAttribute('href', themeURL);
top.ICEcoder.content.contentWindow.document.getElementsByTagName('head')[0].appendChild(styleNode);
activeLineBG = top.theme=="eclipse"||top.theme=="elegant"||top.theme=="neat" ? "#ccc": "#000";
top.ICEcoder.switchTab(top.ICEcoder.selectedTab);
// Tabs indent setting
@@ -1621,6 +1622,7 @@ var ICEcoder = {
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
strCSS = cMCSS.rules ? 'rules' : 'cssRules';
cMCSS[strCSS][5].style['content'] = visibleTabs ? '"\\21e5"' : '" "';
cMCSS[strCSS][2].style.cssText = "background: " + activeLineBG + " !important";
top.tabWidth = tabWidth;
for (var i=0;i<ICEcoder.cMInstances.length;i++) {