lib: allow multiple class definition in html elements
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 19 Jul 2013 01:54:58 +0000 (21:54 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 19 Jul 2013 01:54:58 +0000 (21:54 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/html.nit

index 75acbfa..d4390ad 100644 (file)
@@ -126,6 +126,12 @@ class HTMLTag
        end
        private var classes: Set[String] = new HashSet[String]
 
+       # Add multiple CSS classes
+       fun add_classes(classes: Collection[String]): HTMLTag do
+               self.classes.add_all(classes)
+               return self
+       end
+
        # Set a CSS 'value' for 'prop'
        # var img = new HTMLTag("img")
        # img.css("border", "2px solid black").css("position", "absolute")