Exemple #1
0
        internal virtual void WritePanel(HtmlRenderer htmlRenderer, FlexiTabBlock tabBlock, string blockName, int index)
        {
            ReadOnlyDictionary <string, string> attributes = tabBlock.Attributes;

            htmlRenderer.
            Write("<div class=\"").
            WriteElementClass(blockName, "tab-panel").
            WriteElementBooleanModifierClass(index > 0, blockName, "tab-panel", "hidden").
            WriteAttributeValue(attributes, "class").
            Write('"').
            WriteAttributesExcept(attributes, "class").
            Write(" tabindex=\"0\" role=\"tabpanel\" aria-label=\"").
            WriteLeafInline(tabBlock[0] as LeafBlock, false).     // Html disabled
            WriteLine("\">").
            WriteChildren(tabBlock[1] as ContainerBlock, false).  // Same as default HTML for blockquotes
            WriteEndTagLine("div");
        }
Exemple #2
0
        internal virtual void WriteTab(HtmlRenderer htmlRenderer, FlexiTabBlock tabBlock, string blockName, int index)
        {
            if (index == 0)
            {
                htmlRenderer.
                WriteStartTagWithModifierClassAndAttributes("button",
                                                            blockName,
                                                            "tab",
                                                            "selected",
                                                            "role=\"tab\" aria-selected=\"true\""); // Buttons have tabindex 0 by default
            }
            else
            {
                htmlRenderer.
                WriteStartTagWithAttributes("button",
                                            blockName,
                                            "tab",
                                            "role=\"tab\" aria-selected=\"false\" tabindex=\"-1\"");
            }

            htmlRenderer.
            WriteLeafInline(tabBlock[0] as LeafBlock).
            WriteEndTagLine("button");
        }