Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#2339 closed defect (duplicate)

PopupMenu2 doesn't collapse when mouse click outside menu.

Reported by: guest Owned by: liucougar
Priority: high Milestone:
Component: Widgets Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:

Description

This is probably the same issue as with #2291. The problem is with dojo.widget.PopupManager?.registerWin()

  this.registerWin = function(/*Window*/win){
// summary: register a window so that when clicks/scroll in it, the popup can be     closed automatically
    
if(!win.__PopupManagerRegistered)
    {
      dojo.event.connect(win.document, 'onmousedown', this, 'onClick');
      dojo.event.connect(win, "onscroll", this, "onClick");
      dojo.event.connect(win.document, "onkey", this, 'onKey');
      win.__PopupManagerRegistered = true;
      this.registeredWindows.push(win);
    }
  };

'this' referenced in each dojo.event.connect() refers to the function itself where as it should refer to dojo.widget.PopupManager?. Changing the function to the following works fine.

   this.registerWin = function(/*Window*/win){
     // summary: register a window so that when clicks/scroll in it, the popup can be closed automatically
     if(!win.__PopupManagerRegistered)
     {
       dojo.event.connect(win.document, 'onmousedown', dojo.widget.PopupManager, 'onClick');
       dojo.event.connect(win, "onscroll", dojo.widget.PopupManager, "onClick");
       dojo.event.connect(win.document, "onkey", dojo.widget.PopupManager, 'onKey');
       win.__PopupManagerRegistered = true;
       this.registeredWindows.push(win);
     }
  };

Change History (3)

comment:1 Changed 13 years ago by liucougar

Milestone: 0.4.2
Owner: changed from bill to liucougar

comment:2 Changed 13 years ago by liucougar

Resolution: duplicate
Status: newclosed

dup of #2291

comment:3 Changed 12 years ago by (none)

Milestone: 0.4.2

Milestone 0.4.2 deleted

Note: See TracTickets for help on using tickets.