Skip to content
This repository has been archived by the owner on Oct 9, 2018. It is now read-only.

Commit

Permalink
Fix for issue #666
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Neil committed Feb 8, 2013
1 parent b56643d commit 0f4e249
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 16 deletions.
2 changes: 1 addition & 1 deletion JakeVersion
Expand Up @@ -2,5 +2,5 @@
"major": 0,
"minor": 9,
"revision": 6,
"build": 89
"build": 90
}
2 changes: 1 addition & 1 deletion pkg/bbui-min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/bbui-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/bbui.css
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

/* VERSION: 0.9.6.89*/
/* VERSION: 0.9.6.90*/

body, html {
padding:0;
Expand Down
24 changes: 20 additions & 4 deletions pkg/bbui.js
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

/* VERSION: 0.9.6.89*/
/* VERSION: 0.9.6.90*/

bb = {
scroller: null,
Expand Down Expand Up @@ -847,9 +847,25 @@ bb = {
// returns 'landscape' or 'portrait'
getOrientation: function() {
if (bb.device.is720x720) return 'portrait';
// Orientation is backwards between playbook and BB10 smartphones so we can't rely on the value
// of window.orientation. Orientation denotes "up" and not landscape/portrait
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
// Orientation is backwards between playbook and BB10 smartphones
if (bb.device.isPlayBook) {
// Hack for ripple
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'landscape';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'portrait';
}
} else {
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'portrait';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'landscape';
}
}
},

cutHex : function(h) {
Expand Down
2 changes: 1 addition & 1 deletion samples/bbui.css
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

/* VERSION: 0.9.6.89*/
/* VERSION: 0.9.6.90*/

body, html {
padding:0;
Expand Down
24 changes: 20 additions & 4 deletions samples/bbui.js
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

/* VERSION: 0.9.6.89*/
/* VERSION: 0.9.6.90*/

bb = {
scroller: null,
Expand Down Expand Up @@ -847,9 +847,25 @@ bb = {
// returns 'landscape' or 'portrait'
getOrientation: function() {
if (bb.device.is720x720) return 'portrait';
// Orientation is backwards between playbook and BB10 smartphones so we can't rely on the value
// of window.orientation. Orientation denotes "up" and not landscape/portrait
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
// Orientation is backwards between playbook and BB10 smartphones
if (bb.device.isPlayBook) {
// Hack for ripple
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'landscape';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'portrait';
}
} else {
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'portrait';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'landscape';
}
}
},

cutHex : function(h) {
Expand Down
22 changes: 19 additions & 3 deletions src/core.js
Expand Up @@ -829,9 +829,25 @@ bb = {
// returns 'landscape' or 'portrait'
getOrientation: function() {
if (bb.device.is720x720) return 'portrait';
// Orientation is backwards between playbook and BB10 smartphones so we can't rely on the value
// of window.orientation. Orientation denotes "up" and not landscape/portrait
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
// Orientation is backwards between playbook and BB10 smartphones
if (bb.device.isPlayBook) {
// Hack for ripple
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'landscape';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'portrait';
}
} else {
if (!window.orientation) {
return (window.innerWidth > window.innerHeight) ? 'landscape' : 'portrait';
} else if (window.orientation == 0 || window.orientation == 180) {
return 'portrait';
} else if (window.orientation == -90 || window.orientation == 90) {
return 'landscape';
}
}
},

cutHex : function(h) {
Expand Down

0 comments on commit 0f4e249

Please sign in to comment.