X-Git-Url: http://nitlanguage.org diff --git a/lib/html/bootstrap.nit b/lib/html/bootstrap.nit index 7b5084f..3e12dd7 100644 --- a/lib/html/bootstrap.nit +++ b/lib/html/bootstrap.nit @@ -31,7 +31,7 @@ abstract class BSComponent super Template # CSS classes to add on this element. - var css_classes = new Array[String] + var css_classes = new Array[String] is optional # Render `self` css clases as a `class` attribute. fun render_css_classes: String do @@ -53,11 +53,12 @@ end # # Creates a link with a title attribute: # ~~~ -# lnk = new Link.with_title("http://nitlanguage.org", "Nit", "Nit homepage") +# lnk = new Link("http://nitlanguage.org", "Nit", "Nit homepage") # assert lnk.write_to_string == "Nit" # ~~~ class Link super BSComponent + autoinit(href, text, title, css_classes) # URL pointed by this link. var href: String is writable @@ -66,18 +67,12 @@ class Link var text: Writable is writable # Optional title. - var title: nullable String is noinit, writable - - # Creates a link with a `title` attribute. - init with_title(href: String, text: Writable, title: nullable String) do - init(href, text) - self.title = title - end + var title: nullable String = null is optional, writable redef fun rendering do add "{text}" end end @@ -95,11 +90,12 @@ end # # With subtext: # ~~~ -# var h6 = new Header.with_subtext(6, "Title", "with subtext") +# var h6 = new Header(6, "Title", "with subtext") # assert h6.write_to_string == "