atom feed10 messages in org.dojotoolkit.dojo-interestRe: [Dojo-interest] Opening dijit.Pop...
FromSent OnAttachments
Yann BIZEULAug 22, 2009 3:18 pm 
Bill KeeseAug 22, 2009 3:58 pm 
Yann BIZEULAug 23, 2009 1:25 am 
Yann BIZEULAug 23, 2009 2:04 am 
Bill KeeseAug 23, 2009 4:35 am 
Yann BIZEULAug 23, 2009 5:48 am 
Bill KeeseAug 23, 2009 9:58 am 
Yann BizeulAug 24, 2009 2:09 am 
Bill KeeseAug 24, 2009 6:08 am 
Yann BizeulAug 24, 2009 6:12 am 
Subject:Re: [Dojo-interest] Opening dijit.PopupMenuBarItem on mouse over
From:Bill Keese (wke@gmail.com)
Date:Aug 24, 2009 6:08:33 am
List:org.dojotoolkit.dojo-interest

Sorry, I didn't think this would be so hard; I guess we should add an official option to do this. I just tried the code below and it seems to work, assuming you want the menu to appear instantly rather than after a timeout:

dijit._MenuBase.prototype.onItemHover = function(item){

this.focusChild(item);

if(this.focusedChild.popup && !this.focusedChild.disabled){

this._openPopup();

}

};

On Mon, Aug 24, 2009 at 6:10 PM, Yann Bizeul <ml@tynsoe.org> wrote:

Thanks Bill It is better, but it looks like this override is too late for the first event.

When I put the mouse on a menu item, the menu bar gets focus, but the menu does not come. If I hover the mouse on another item, it works perfectly.

I tried to reverse the "super" call like this :

oldFunc = dijit.MenuItem.prototype._onHover; dijit.MenuItem.prototype._onHover = function(){

this.focus();

oldFunc.apply(this, arguments); };

Then the menu comes as it should, but never closes !

Le 23 août 2009 à 18:58, Bill Keese a écrit :

Ah you are right, my mistake. Hmm well MenuItem has a _onHover event, you could probably override that to automatically focus, something like: oldFunc = dijit.MenuItem.prototype._onHover; dijit.MenuItem.prototype._onHover = function(){ oldFunc.apply(this, arguments); this.focus(); };

Combined with the previous change that seems like it would work.

On Sun, Aug 23, 2009 at 9:49 PM, Yann BIZEUL <reg-@tynsoe.org> wrote:

As far as I get the way it works, this is not gonna solve my problem : Hovering the menu does not make it take focus, iirc, so maybe I need to take focus first then open the menu ?

The problem is not to show the menu as soon as it gets focus, the problem is to open the menu (eventually take focus) when the mouse hovers the menu. I tried to do that by establishing more or less random connections without success.

*Yann Bizeul** -** *yann at tynsoe.org *Cocoa Developer*

*Tynsoe Projects* BuddyPop - GeekTool - SSH Tunnel Manager - ... http://projects.tynsoe.org/

Le 23 août 2009 à 13:35, Bill Keese a écrit :

Yah, it's not documented because it's not an official function for developers to use (it should have been called _focusChild I guess), but you could override it in a number of ways, I think this will work: dojo.addOnLoad(function(){ dijit.MenuBar.prototype.focusChild = function(){ this.inherited(arguments): this._openPopup(); } });

That's a simplified version of the definition in MenuBar.js (you should open that file and take a look at the current definition).

On Sun, Aug 23, 2009 at 5:26 PM, Yann BIZEUL <reg-@tynsoe.org> wrote:

Thanks Bill, Indeed, if I call dijit.byId("navMenu").focus() in the console, I can hover the menu to show them.

But I don't see what you mean by overriding focusChild() and can't find any documentation related to such thing. The official doc on focusChild just says nothing. Well, I'm completely lost !

Thanks

*Yann Bizeul** -** *yann at tynsoe.org *Cocoa Developer*

*Tynsoe Projects* BuddyPop - GeekTool - SSH Tunnel Manager - ... http://projects.tynsoe.org/

Le 23 août 2009 à 00:59, Bill Keese a écrit :

That actually happens already, except that the MenuBar needs to initially be focused by clicking it. IE, if the "File" menu is open and then you move the mouse to "Edit" the submenu opens instantly. I think to avoid that initial focus restriction you'd need to override MenuBar.focusChild().

On Sun, Aug 23, 2009 at 7:19 AM, Yann BIZEUL <reg-@tynsoe.org>wrote:

Hi list I'm really new to dojo, and trying to understand a lot in a short time, so that's reallt difficult for now, but hopefully, O'reilly book will help me. One thing I did not find a solution for, in that book, or anywhere on the web, is how I can make a menu from a MenuBar open itself on mouseover ?

I tries different combinations, usin dojo.connect or <script type="dojo/connect without success.

The best I got was using :

<script type="dojo/connect" event="onMouseEnter" args="event"> dijit.byId("passwordMenu")._openMyself(event); </script>

but the menu appear at the wrong location (just under the mouse at the location of the mouseOver event.

Thanks for your help

*Yann Bizeul** -** *yann at tynsoe.org *Cocoa Developer*

*Tynsoe Projects* BuddyPop - GeekTool - SSH Tunnel Manager - ... http://projects.tynsoe.org/

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________ FAQ: http://dojotoolkit.org/support/faq Book: http://docs.dojocampus.org Dojo@mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest