OpenLayers OpenLayers

Ticket #614 (closed feature: fixed)

Opened 2 years ago

Last modified 1 year ago

Panel element refactoring

Reported by: crschmidt Assigned to:
Priority: minor Milestone: 2.4 Release
Component: Control Version: SVN
Keywords: Cc:
State:

Description

Refactor Control.Panel so that it has elements which are more than transient. The end result of this is that:

  • Controls have a panel_div which can be modified (for example, to contain a tooltip)
  • Destroy() takes care of cleaning up events
  • Events are registered once instead of every time the panel is redrawn

This has been tested in Opera, Safari, and Firefox.

This also satisfies a recent request from Andreas on the OL-users mailing list.

Attachments

panel.patch (3.7 kB) - added by crschmidt on 04/01/07 21:28:53.
614.patch (3.7 kB) - added by sderle on 04/01/07 22:20:02.
crschmidt's patch plus slightly simplified Event.stop listener registration

Change History

04/01/07 21:28:53 changed by crschmidt

  • attachment panel.patch added.

04/01/07 22:20:02 changed by sderle

  • attachment 614.patch added.

crschmidt's patch plus slightly simplified Event.stop listener registration

04/01/07 22:20:46 changed by sderle

why pass in OpenLayers.Event.stop.bindAsEventListener() when you could just pass OpenLayers.Event.stop? I see the original code does this, but let's clean it up some. 614.patch does this.

Also, what's with the switch around evt ? evt : window.event in onClick? Isn't OL supposed to take care of this for us?

04/02/07 06:45:58 changed by crschmidt

You can't just pass in OpenLayers.Event.stop, because OpenLayers.Event.stop expects to be passed 'evt' as a first parameter:

  stop: function(event) {
    if (event.preventDefault) {
      event.preventDefault();
      event.stopPropagation();
    } else {
      event.returnValue = false;
      event.cancelBubble = true;
    }
  },

We used Event.stop when we wrote it together, until I realized that it never worked :)

bindAsEventListener takes care of the evt : window.evt check, but when we wrote it, we used 'bind'. I don't have a strong feeling either way on this, so I can switch it to use bindAsEventListener if we prefer.

04/02/07 09:55:23 changed by sderle

  • keywords changed from review to commit.

no, I see your point. go ahead and commit your original patch. thanks.

04/02/07 10:11:07 changed by crschmidt

  • status changed from new to closed.
  • resolution set to fixed.

07/05/07 16:55:00 changed by euzuro

  • keywords deleted.