private void UpdateParens() { jQueryObject rows = rowsDiv.Children(); if (rows.Length == 0) { return; } rows.RemoveClass("paren-start"); rows.RemoveClass("paren-end"); rows.Children("div.l").CSS("display", rows.Length == 1 ? "none" : "block"); rows.First().Children("div.l").Children("a.rightparen, a.andor").CSS("visibility", "hidden"); for (int i = 1; i < rows.Length; i++) { jQueryObject row = rows.Eq(i); row.Children("div.l").CSS("display", "block") .Children("a.lefparen, a.andor").CSS("visibility", "visible"); } bool inParen = false; for (int i = 0; i < rows.Length; i++) { jQueryObject row = rows.Eq(i); jQueryObject divParen = row.Children("div.l"); jQueryObject lp = divParen.Children("a.leftparen"); jQueryObject rp = divParen.Children("a.rightparen"); if (rp.HasClass("active") && inParen) { inParen = false; if (i > 0) { rows.Eq(i - 1).AddClass("paren-end"); } } if (lp.HasClass("active")) { inParen = true; if (i > 0) { row.AddClass("paren-start"); } } } }
public static string OuterHtml(this jQueryObject element) { return(J("<i/>").Append(element.Eq(0).Clone()).GetHtml()); }