google-code-export / wiquery

Automatically exported from code.google.com/p/wiquery
MIT License
1 stars 1 forks source link

Add hoverintent to Accordion #140

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The accordion is a great place to have Hoverintent, since it's a bit jumpy in 
mouseover mode without hoverintent.  This patch provides that functionality.

Original issue reported on code.google.com by brian.topping on 30 Nov 2010 at 7:41

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Brian,

I've got fourcomments about your code:
1) The license: we are on the MIT license. I don't know if we can mix this 
license with the Apache2 license

2) HoverIntentJavaScriptResourceReference should inherit the 
WiQueryJavascriptResourceReference

3) What about the public AccordionTriggerEvent getEvent() ? (I can see a 
problem of conversion)

4) Hoverintent is not a based option of the Accordion. And maybe the jQuery UI 
team will provide for the next release (with a different name). So, maybe we 
can provide an interface for the AccordionTriggerEvent enumeration and create 
another enumeration with this interface and with your HOVERINTENT (I don't 
know, because the getEvent return the AccordionTriggerEvent enumeration. So, we 
can loose backward)

If we can resolve the three first points, I think we can use your patch.

Thank you for your contribution !!

Regards

Julien Roche

Original comment by roche....@gmail.com on 30 Nov 2010 at 8:00

GoogleCodeExporter commented 9 years ago
@Brian

I thought you mean create a new patch for wiquery-plugins project not wiquery 
itself:-)

For me this makes sense if you want to have some kind of extension of accordion 
but not sure we should add that wiquery core.

Regards,

Ernesto

Original comment by reier...@gmail.com on 30 Nov 2010 at 8:12

GoogleCodeExporter commented 9 years ago
Yep,

You can find some based of plugins on this link: 
http://code.google.com/p/wiquery-plugins/

Cheers

Julien Roche

Original comment by roche....@gmail.com on 30 Nov 2010 at 8:59

GoogleCodeExporter commented 9 years ago
Hi guys, thanks for your consideration.  I am a beginner with jQuery/wiQuery 
and just had something that worked well for me and wanted to share it.  As you 
can see, I just grabbed the existing Hover* class that Ernesto had done in 
plugins (which was ASF licensed) and put it together with a different js, then 
patched the accordion to work with different options.  I put a comment in the 
code that I didn't know what the best way to go about this was.  My 
contribution here should be considered an unrestricted grant that can be 
relicensed at will.  I claim no ownership of it.

The reason I did it in the main project was because there can't be a dependency 
from the main project to the plugins project.  I see what you mean about the 
jQuery team not having a hover option, this is where my inexperience with their 
patterns is a problem.  It did seem that hover intent is a mixin, I just didn't 
know how to best express that in the code.  Maybe it shouldn't touch Accordion 
at all.

I really appreciate the attention, but I have this working in my own code 
without the patch by subclassing Accordion and setting the options manually.  I 
was just trying to share with the community and help move things forward a 
little bit.  Accordion mouseovers are a *lot* nicer with hover intent.

Cheers guys!

Brian

Original comment by brian.topping on 30 Nov 2010 at 4:40

GoogleCodeExporter commented 9 years ago
I close for the moment this issue. Maybe you can provide an issue into the 
wiquery-plugins google project to add a plugin for the hoverintent ?

Cheers

Julien Roche

Original comment by roche....@gmail.com on 7 Dec 2010 at 7:49

GoogleCodeExporter commented 9 years ago
No worries, I just use an inner subclass in my Page class:

    private static class HoverIntentAccordion extends Accordion {
        public HoverIntentAccordion() {
            super("accordion");
            getOptions().putLiteral("event", "click hoverintent");
        }

        @Override
        public void contribute(WiQueryResourceManager wiQueryResourceManager) {
            super.contribute(wiQueryResourceManager);
            wiQueryResourceManager.addJavaScriptResource(HoverIntentJavaScriptResourceReference.get());
        }
    }

It didn't make a lot of sense to me how else this could be implemented outside 
of wiquery-core, nor does it seem to make sense as a plugin.  It's a small 
amount of code to add to get the additional functionality, but I'm set so no 
big deal on my end.  

Cheers, Brian

Original comment by brian.topping on 7 Dec 2010 at 8:07