blackberry / bbUI.js

BlackBerry UI look and feel JavaScript toolkit for WebWorks
Apache License 2.0
312 stars 192 forks source link

Weird bbUI Resolution Flags bug on WebWorks 2.0 (Cordova)? #998

Closed johnbiiibs closed 10 years ago

johnbiiibs commented 10 years ago

Hi,

I've been getting this weird bug with the Resolution Flags (bb.device.is720x720 for example on Q10).

See screenshot below: screen shot 2013-12-25 at 4 11 59 am

If I use bb.device.is720x720, the condition fails, hence moving to the final "catching else" clause; in my screenshot it's CHOICE: E.

But if I use: screen shot 2013-12-25 at 4 21 04 am Things would work out fine.

I think it's causing issues such as this one (Yes I am experiencing the same issue on a Z30 on the latest version of BB 10): Issue https://github.com/blackberry/bbUI.js/issues/975

Any ideas on what might have caused this?

I am using: bbUI for BB10 VERSION: 0.9.6.932 WebWorks 2.0 (the one with Cordova)

Z10 OS Version: 10.2.0.1767 Q10 OS Version: 10.2.0.1083

Thanks and regards, John

johnbiiibs commented 10 years ago

Turns out that the resolution flags on line 66, all return false.

The window.innerHeight and window.innerWidth both return "346"; meaning the Resolution Flags are not getting the proper values.

So what I did was to initialise the resolution flags somewhere else, mainly the doLoad() function: test

Not much of a workaround but it works.

I think this might have something to do with WebWorks 2.0, replacing the "webworksready" event with the cordova "deviceready" event.

tneil commented 10 years ago

I've checked in what I believe is a fix for this issue into the 10.3 branch where I'm doing my current work.