Pete
> --
> You received this message because you are subscribed to the Google Groups "Lift" group.
> To post to this group, send email to lif...@googlegroups.com.
> To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
>
Sounds reasonable. Please add a ticket and assign it to me. I'll
take care of this and the couple of other CSS transform tickets in the
next couple of days.
Pete
On Sep 14, 3:29 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> On Wed, Sep 14, 2011 at 7:34 PM, Peter Brant <peter.br...@gmail.com> wrote:Hm. I see where that can be useful, but it seems non-intuitive as the
> > Sounds reasonable. Please add a ticket and assign it to me. I'll
> > take care of this and the couple of other CSS transform tickets in the
> > next couple of days.
>
> Actually, I think attribute merging is feature, not a bug:
>
> scala> val f = "*" #> <i/>
> f: net.liftweb.util.CssSel = CssBind(Full(*), Full(StarSelector(Empty)))
>
> scala> f(<a href="foo"/>)
> res0: scala.xml.NodeSeq = NodeSeq(<i href="foo"></i>)
>
> scala>
>
> I spent a lot of time making it work correctly.
>
> I'm all for a flag that says "don't merge attributes", but removing the
> feature would be a bad thing(tm)
default option.
Then again, intuitiveness is in the eye of the
beholder. It's probably the case that attribute merging makes more
sense when the right hand side is a NodeSeq, and attribute replacement
makes more sense when the right hand side is a NodeSeq => NodeSeq.
Would the flag be a new replacement rule? If so, I propose:
% replaces all matching elements with the values, merging attributes
"* %" #> <i/> // <a href="foo"/> -> <i href="foo"/>
!% replaces all matching element, no attribute merging
"* !%" #> (ns: NodeSeq) => <i>{ns}</i> // <a href="foo"/> -> <i><a
href="foo"/></i>
% is equivalent to what currently happens when there is no replacement
rule.
And if anyone wants to change the default to !%, I wouldn't object :-)
dave
<><
--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
>
> One of the biggest complains about Helpers.bind() was that it did *not*
> merge attributes. Basically, designers would do something like <input
> name="firstname" class="foo bar" id="baz"> and then in the CSS Selector
> Transforms, you do: "name=firstname" #> SHtml.text(name, name = _) and you
> *want* the attributes merged.
>
Yeah, very slick.
Pete