[OpenLayers-Dev] Control.Panel: main-<div> and handling of
mousedown-events
Marc Jansen
jansen at terrestris.de
Tue Nov 30 06:04:56 EST 2010
Hi Andreas,
please find comments inline.
On 30.11.2010 11:38, Andreas Hocevar wrote:
> Hi Marc,
>
> I think your use case is a rather specific one - and achieving the behavior you want is a one-liner.
Agreed.
> It works even if shortened:
>
> OpenLayers.Event.observe(myPanel.div, "mousedown", OpenLayers.Event.stop);
>
> To me it feels like this is easy enough to do it on the application level.
It's perfectly OK for me to do it like you suggested.
> Your patch, without making the behavior configurable, would cause unexpected behavior in controls like PanPanel, where the whole space within the rectangle that holds the control's buttons would not react to mouse interaction any more.
That is why I wanted to start discussion first.
Summarized, I'll catch the specific issue at the application level and
everything is fine.
Thanks again for your comments and best regards,
Marc
> Regards,
> Andreas.
>
> On Nov 30, 2010, at 09:49 , Marc Jansen wrote:
>
>> Hi list,
>>
>> currently mousedowns/clicks that happen directliy on the<div> of a Control.Panel are not being stopped but are being sent e.g. to the map the panel-divs lies over.
>>
>> This might be useful in some setups, in mine it isn't. I was wondering whether we should make it configurable to have the panel<div> stop the mousedown event or whether this even can be considered a bug.
>>
>> What do you think?
>>
>> I wanted to discuss this first before opening a ticket. The attached patch fixes my personal issue, but stops mousedowns on the Control.Panel-<div> in any case, e.g. it is not configurable via a config-option. It'd be easy to wrap that in a conditional, of course.
>>
>> Thanks for any response and regards,
>>
>> Marc
>>
>>
>> BTW: how would you test (speaking of unit-tests) that the new behaviour does what it is supposed to do? Is there documentation on how to test eventhandling and simulating e.g. clicks? Which testfile can I use to learn from source?
>> <panel-div-stop-mousedown-001.patch>_______________________________________________
>> Dev mailing list
>> Dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
More information about the Dev
mailing list