Ticket #2959 (closed bug: fixed)
instance of Array + GWT + Buttons + IFRAME = BUG in Panel.js
| Reported by: | grigoryevigor | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2.11 Release |
| Component: | Control.Panel | Version: | 2.10 |
| Keywords: | instanceof Array IFRAME GWT Panel | Cc: | |
| State: | Pullup |
Description
I'm using wrapper with OL API in GWT application. I found problem with Array type detection in OL. It just not works for array passed from other frame (see: http://javascript.crockford.com/remedial.html).
As for me the problem resides in Panel.js addControls function
/*-------------------------------------------------------------*/
addControls: function(controls) {
if (!(controls instanceof Array)) {
controls = [controls];
} this.controls = this.controls.concat(controls);
/*-------------------------------------------------------------*/
failing to detect type correctly, it wraps array once more to the effect of nonsense. I also found 40 places using similar sintax around a project code. I'm suggesting to replace instanceof with a typeOf function usage from example (see URL above).

