Permalink
Browse files

Closes #1025. namespace-style attributes for designer-friendly snipp…

…et invocation
  • Loading branch information...
dpp committed Aug 25, 2011
1 parent d98b451 commit 4b5cd52c9f45efe37e6fb528c88d5496323c2f3f
@@ -72,6 +72,10 @@ object Menu extends DispatchSnippet {
* <li>expand - Controls whether or not to expand child menus. Defaults to <pre>true</pre>.</li>
* </ul>
*
+ * <p>If you are using designer friendly invocation, you can access the namespaced attributes: <br/>
+ * &lt;div class="lift:Menu?li_item:class=foo+bar"&gt;menu&lt;/div&gt;
+ * </p>
+ *
* <p>For a simple, default menu, simply add</p>
*
* <pre>
@@ -1671,6 +1671,7 @@ for {
def prefixedAttrsToMap(prefix: String, start: Map[String, String]): Map[String, String] =
attrs.reverse.flatMap {
case (Right((pre, name)), value) if pre == prefix => List((name, value))
+ case (Left(name), value) if name.startsWith(prefix + ":") => List(name.substring(prefix.length + 1) -> value)
case _ => Nil
}.foldRight(start) {
case ((name, value), at) => at + (name -> value)

0 comments on commit 4b5cd52

Please sign in to comment.