-
Notifications
You must be signed in to change notification settings - Fork 881
Missing .clone() API? #48
Comments
It's in the new release. |
I see clone() in 0.9.1a but it seems to return an HTML element instead of a set. |
What do you mean by "set" do you mean a deep clone? |
By "set" I mean jQuery selector result type to which one can apply jQuery methods. In jQuery I can write: var a = $('#someid').clone(); a.removeAttr('id'); but in jQ.Mobi I have to extra wrap .clone() result in $() to do same: var a= $($('#someid').clone()); a.removeAttr('id'); |
I see what you mean so you basically want to be able to chain : $('#someid').clone().removeAttr('id'); I'm sure Ian can manage this, I had a similar request with $('#someid').parent().addClass('blah'); - he sorted it in 2 mins :) |
Also .clone() is a deep clone in jQuery - can you make it so in jQ.Mobi? |
clone takes in a parameter "deep" which will copy in all the children. It does not copy events (nor will it). |
No events copy is fine, but I'd like to see same behavior as jQuery, where deep=true by defaul. Thanks, |
Got it...I'll make that change. Thanks! |
BTW, you are also missing jQuery ().data() API ... |
Hardly - it's only an attribute :) But In know what you mean. $(''selector").attr("data-twaddle"); |
Actually it's in the code and has been, just not documented. You get points though because evidently you're the only one to read the actually Readme.md file ;) We'll have better documentation for the 1.0 release. |
I don't see an API call similar to jQuery .clone() method.
Is there anything like it in jQ.Mobi?
I use it a lot to build lists dynamically.
Thanks,
Alex
The text was updated successfully, but these errors were encountered: