Skip to content

Commit

Permalink
Closes lift#1025. namespace-style attributes for designer-friendly sn…
Browse files Browse the repository at this point in the history
…ippet invocation
  • Loading branch information
dpp committed Aug 25, 2011
1 parent d98b451 commit 4b5cd52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions web/webkit/src/main/scala/net/liftweb/http/S.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b5cd52

Please sign in to comment.