nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d5356e
)
lib: allow multiple class definition in html elements
author
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 19 Jul 2013 01:54:58 +0000
(21:54 -0400)
committer
Alexandre 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
patch
|
blob
|
history
diff --git
a/lib/html.nit
b/lib/html.nit
index
75acbfa
..
d4390ad
100644
(file)
--- a/
lib/html.nit
+++ b/
lib/html.nit
@@
-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")