Permalink
Browse files

added ability to add custom CSS to panel cell & component for tempora…

…ry uses
  • Loading branch information...
markentingh committed Jun 12, 2017
1 parent ba0ab1f commit 851cb8bd350fe1ffffe783b9bbf30dfc15eb0551
Showing with 10 additions and 2 deletions.
  1. +1 −1 App/CSS/editor.less
  2. +1 −1 App/Core/Component.cs
  3. +7 −0 App/Core/Page.cs
  4. +1 −0 App/Core/Panel.cs
View
@@ -165,7 +165,7 @@
/* component specific */
.component.c-textbox{word-break: break-word;
.placeholder-area{padding:20px 20px; text-align:center; border:4px solid;
&.is-body-area{padding:300px 20px;}
&.is-body-area{padding:300px 20px; height:100%; box-sizing:border-box;}
}
}
.text-toolbar{position:absolute; z-index:3001;
View
@@ -352,7 +352,7 @@ public string Render()
}
//add compiled CSS to renderer
S.css.Add("block_" + blockId, css.ToString());
S.css.Add("block_" + blockId, css.ToString() + (this.css != "" ? "#c" + id + "{" + this.css + "}" : ""));
//add component reference (with instance-specific resource references) to page
js.Append("S.components.add('" + id + "', '" + Name + "', [");
View
@@ -514,7 +514,13 @@ private string renderLayout()
{
//replace panel content with placeholder content
panel.cells[0].components.Clear();
var cell = panel.cells[0];
var text = (Components.Textbox)createNewComponent("Textbox", panel.id, panel.cells[0].id, block.id);
if (block.name == "Page Body")
{
cell.css += "height:100%;";
text.css = "height:100%;";
}
text.text = "<div class=\"placeholder-area" +
(block.name.ToLower() == "page body" ? " is-body-area" : "") +
"\"><h4>Shadow Template - Page Block: " + block.name.Replace("Page ","") + "</h4>" +
@@ -527,6 +533,7 @@ private string renderLayout()
text.position[4] = pos;
text.isTemporary = true;
panel.isDisabled = true;
panel.cells[0] = cell;
}
htm.Append(panel.Render());
}
View
@@ -152,6 +152,7 @@ public string Render()
var divcell = new Utility.DOM.Element("div");
divcell.Classes.Add("is-cell");
if (isDisabled) { divcell.Classes.Add("is-disabled"); }
if(cell.css != "") { divcell.Attributes.Add("style",cell.css); }
divcell.id = "cell_" + cell.id.Replace("-", "_").Replace(" ","_");
divcell.innerHTML = cell.head + comps.ToString() + cell.foot;
htm.Append(divcell.Render());

0 comments on commit 851cb8b

Please sign in to comment.