Commit 31a773ea authored by Nick Poulden's avatar Nick Poulden
Browse files

Device type recognition for Touch examples

parent 5f40da6f
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -36,8 +36,13 @@ Ext.define('Docs.view.examples.Device', {
        this.tpl = new Ext.XTemplate(
            '<div class="touchExample {device} {orientation}">',
                '<iframe id={id} style="width: {width}; height: {height}; border: 0;" ',
                        'src="{url}"></iframe>',
            '</div>'
                        'src="{[this.deviceUrl(values)]}"></iframe>',
            '</div>',
            {
                deviceUrl: function(values) {
                     return values.url + "?deviceType=" + (values.device === 'tablet' ? 'Tablet' : 'Phone')
                }
            }
        );
    },

+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ Ext.define('Docs.view.examples.TouchContainer', {
            iframe.onload = function() {
                var style = document.createElement("style");
                // Scale to 70% of original. Default font-size is 114%
                style.innerHTML = "body {font-size: 79.8% !important}";
                style.innerHTML = "body { font-size: 79.8% !important; } html { overflow: hidden };";
                iframe.contentWindow.document.body.appendChild(style);
            };
        }