Permalink
Browse files

updates to the viewport settings

  • Loading branch information...
1 parent 77faf99 commit b9e922a8440c159b93f46a9b7bd2e8a45449ae97 Tim Neil committed Aug 27, 2012
Showing with 31 additions and 34 deletions.
  1. +10 −11 pkg/bbui-0.9.4.js
  2. +10 −11 samples/bbui-0.9.4.js
  3. +11 −12 src/core.js
View
@@ -54,17 +54,6 @@ bb = {
}
}
- // Set our meta tags for content scaling
- var meta = document.createElement('meta');
- meta.setAttribute('name','viewport');
- if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {
- meta.setAttribute('content','initial-scale=0.445,user-scalable=no');
- } else {
- meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
- }
- document.head.appendChild(meta);
-
-
// Initialize our flags once so that we don't have to run logic in-line for decision making
bb.device.isRipple = (navigator.userAgent.indexOf('Ripple') >= 0);
bb.device.isPlayBook = (navigator.userAgent.indexOf('PlayBook') >= 0) || ((window.innerWidth == 1024 && window.innerHeight == 600) || (window.innerWidth == 600 && window.innerHeight == 1024));
@@ -84,6 +73,16 @@ bb = {
bb.device.isHiRes = screen.width > 480 || screen.height > 480;
}
+ // Set our meta tags for content scaling
+ var meta = document.createElement('meta');
+ meta.setAttribute('name','viewport');
+ if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {// this should eventually be changed to if(bb.device.isBB10 && !bb.device.isPlayBook)
+ meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) +',user-scalable=no');
+ } else {
+ meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
+ }
+ document.head.appendChild(meta);
+
// Create our shades of colors
var R = parseInt((bb.cutHex(bb.options.highlightColor)).substring(0,2),16),
G = parseInt((bb.cutHex(bb.options.highlightColor)).substring(2,4),16),
View
@@ -54,17 +54,6 @@ bb = {
}
}
- // Set our meta tags for content scaling
- var meta = document.createElement('meta');
- meta.setAttribute('name','viewport');
- if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {
- meta.setAttribute('content','initial-scale=0.445,user-scalable=no');
- } else {
- meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
- }
- document.head.appendChild(meta);
-
-
// Initialize our flags once so that we don't have to run logic in-line for decision making
bb.device.isRipple = (navigator.userAgent.indexOf('Ripple') >= 0);
bb.device.isPlayBook = (navigator.userAgent.indexOf('PlayBook') >= 0) || ((window.innerWidth == 1024 && window.innerHeight == 600) || (window.innerWidth == 600 && window.innerHeight == 1024));
@@ -84,6 +73,16 @@ bb = {
bb.device.isHiRes = screen.width > 480 || screen.height > 480;
}
+ // Set our meta tags for content scaling
+ var meta = document.createElement('meta');
+ meta.setAttribute('name','viewport');
+ if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {// this should eventually be changed to if(bb.device.isBB10 && !bb.device.isPlayBook)
+ meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) +',user-scalable=no');
+ } else {
+ meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
+ }
+ document.head.appendChild(meta);
+
// Create our shades of colors
var R = parseInt((bb.cutHex(bb.options.highlightColor)).substring(0,2),16),
G = parseInt((bb.cutHex(bb.options.highlightColor)).substring(2,4),16),
View
@@ -38,17 +38,6 @@ bb = {
}
}
- // Set our meta tags for content scaling
- var meta = document.createElement('meta');
- meta.setAttribute('name','viewport');
- if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {
- meta.setAttribute('content','initial-scale=0.445,user-scalable=no');
- } else {
- meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
- }
- document.head.appendChild(meta);
-
-
// Initialize our flags once so that we don't have to run logic in-line for decision making
bb.device.isRipple = (navigator.userAgent.indexOf('Ripple') >= 0);
bb.device.isPlayBook = (navigator.userAgent.indexOf('PlayBook') >= 0) || ((window.innerWidth == 1024 && window.innerHeight == 600) || (window.innerWidth == 600 && window.innerHeight == 1024));
@@ -68,6 +57,16 @@ bb = {
bb.device.isHiRes = screen.width > 480 || screen.height > 480;
}
+ // Set our meta tags for content scaling
+ var meta = document.createElement('meta');
+ meta.setAttribute('name','viewport');
+ if (navigator.userAgent.indexOf('Version/10.0.0.1337') >= 0) {// this should eventually be changed to if(bb.device.isBB10 && !bb.device.isPlayBook)
+ meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) +',user-scalable=no');
+ } else {
+ meta.setAttribute('content','initial-scale=1.0,width=device-width,user-scalable=no,target-densitydpi=device-dpi');
+ }
+ document.head.appendChild(meta);
+
// Create our shades of colors
var R = parseInt((bb.cutHex(bb.options.highlightColor)).substring(0,2),16),
G = parseInt((bb.cutHex(bb.options.highlightColor)).substring(2,4),16),
@@ -673,4 +672,4 @@ Function.prototype.bind = function(object){
return function(){
return fn.apply(object, arguments);
};
-};
+};

0 comments on commit b9e922a

Please sign in to comment.