Commit d282df3d authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Always add overflow:hidden to Touch examples.

Previously the overflow rule was together with font-size:79.8%,
but that was only applied to Tablet examples.
parent 6a60ee64
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -81,15 +81,18 @@ Ext.define('Docs.view.examples.TouchContainer', {

    // Scale down the example when in tablet mode
    updateScale: function() {
        if (this.device.getDevice() === "tablet") {
        var iframe = Ext.query('iframe', this.el.dom)[0];
        iframe.onload = function() {
            var style = document.createElement("style");
            var styleContent = "html { overflow: hidden }";

            // Scale to 70% of original. Default font-size is 114%
                style.innerHTML = "body { font-size: 79.8% !important; } html { overflow: hidden };";
            if (this.device.getDevice() === "tablet") {
                styleContent += "body { font-size: 79.8% !important; }";
            }
            style.innerHTML = styleContent;
            iframe.contentWindow.document.body.appendChild(style);
        };
        }
    },

    updateTitle: function() {
+12 −8
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@

    <style id="iframe-css" type="text/css"></style>
    <style type="text/css" media="screen">
        html {
            overflow: hidden
        }

        .home {
            text-align: center;
        }
@@ -67,7 +71,7 @@
                }
                if (options.tablet) {
                    // Scale example down to 70% size. Default font-size is 114%
                    Ext.get('iframe-css').update("body {font-size: 79.8% !important} html {overflow: hidden}");
                    Ext.get('iframe-css').update("body {font-size: 79.8% !important}");
                }
                eval(code);
            } catch (e) {