[TIMOB-16933] CSS/Javascript not rendering properly
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2014-05-10T07:35:02.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | 2014 Sprint 09, 2014 Sprint 09 Tooling |
| Components | Windows Hybrid |
| Labels | n/a |
| Reporter | Jamil Spain |
| Assignee | Chris Barber |
| Created | 2014-05-08T18:23:18.000+0000 |
| Updated | 2017-03-03T21:32:03.000+0000 |
I need more information. I need a test case that proves that this bug is not just a problem with the way the application was designed.
This is a non-issue as far as Titanium is concerned. They are putting HTML into a native WP8 WebBrowser object and the content does not have a meta viewport tag, thus there's no initial scale and the device zooms in on the content. They can fix their app by detecting if the HTML content has a meta viewport tag and if not add it. Here's example code:
// viewportify if (html) { html = String(html); var metaTags = html.match(/<meta\s*(?:(?:\b(?:\w|-)+\b\s*(?:=\s*(?:"[^"]*"|'[^']*'|[^"'<> ]+)\s*)?)*)\/?\s*>/g), viewportExists = false, viewport = '<meta name="viewport" content="width=device-width,initial-scale=1.0">', i, j, k, l, attrs; if (metaTags) { for (i = 0, l = metaTags.length; i < l; i++) { attrs = metaTags[i].match(/(?:\w|-)+\b\s*(?:=\s*(?:"[^"]*"|'[^']*'|[^"'<> ]+))?/g); if (attrs) { for (j = 0, k = attrs.length; j < k; j++) { if (/name\s*=\s*(?:"viewport"|'viewport')/.test(attrs[j])) { viewportExists = true; break; } } } } } if (!viewportExists) { var p = html.indexOf('</head>'); if (p != -1) { html = html.substring(0, p - 1) + viewport + html.substring(p); } else { p = html.indexOf('<body'); if (p != -1) { html = html.substring(0, p - 1) + '<head>' + viewport + '</head>' + html.substring(p); } else { // no body, skip } } alert('Added viewport meta tag!\n\n' + html); } }Closing as invalid.