Abdallah wrote:
> I have replaced the following:
> $(_o.trigger).bind("click",{'s':s},function(e) {
> return
> (!hash[e.data.s]['active'])?$.jqm.open(hash[e.data.s],this):false;});
> // sending the hash instead of it's index
>
> open:function(mh,trig){ // using the hash directly
> var h=mh; h.t=trig;
> var c=h.c; h.cc='.'+c.closeClass;
> var z=c.zIndex; if (c.focus) z+=10; if (c.overlay == 0) z-=5;
> if(!$.isFunction( h.q)) h.q=function(){return $.jqm.close(mh)};
> h['active']=true;
>
> ....
> close:function(mh){var h=mh; h['active'] = false;
>
> Now, I'm new to javascript and to jQuery, and I don't know if the
> solution is optimal, but it worked for me.
>
> Still have to work with some call back issues, but I think I just saw
> something about that posted yesterday.
> If you have comments on my changes or a better solution please let me
> know.
Abdallah,
Nice work. I am not certain why the index was not being passed
properly before ... are you using jQuery 1.1.1? REGARDLESS ... I think
that your design may be better (providing a copy of the hash isn't made
when it's attached to the submit -- which has the potential to slow
things down on low memory machines). I believe you can cut down the code
further by changing;
close:function(mh){var h=mh; h['active'] = false;
to
close:function(h){h['active'] = false;
(&& doing the same thing in open function)
If this proves to be efficient I'll adopt this method in the next rewrite.
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/