inject smartphone.css dynamically in code/smartphone.js - this makes it easy to switch between modes on a URL parameter

fix #88
This commit is contained in:
Jon Atkins
2013-03-29 00:49:46 +00:00
parent bd736bab10
commit 39f5f9db2e
2 changed files with 6 additions and 4 deletions

View File

@ -20,6 +20,11 @@ window.runOnSmartphonesBeforeBoot = function() {
if(!isSmartphone()) return;
console.warn('running smartphone pre boot stuff');
// add smartphone stylesheet
headHTML = document.getElementsByTagName('head')[0].innerHTML;
headHTML += '<style>@@INCLUDESTRING:mobile/smartphone.css@@</style>';
document.getElementsByTagName('head')[0].innerHTML = headHTML;
// disable zoom buttons to see if they are really needed
window.localStorage['iitc.zoom.buttons'] = 'false';