From b999489c8968c5c76e81d9656904990fc2ac04cf Mon Sep 17 00:00:00 2001 From: Quentin Stoeckel Date: Thu, 28 Apr 2016 23:38:53 +0200 Subject: [PATCH] Fix browser action on Firefox --- data/browser-action/css/style.scss | 15 ++++++--------- data/browser-action/index.html | 4 ++-- data/browser-action/js/script.js | 8 ++++++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/data/browser-action/css/style.scss b/data/browser-action/css/style.scss index 1e06394..977c4e1 100644 --- a/data/browser-action/css/style.scss +++ b/data/browser-action/css/style.scss @@ -11,15 +11,15 @@ @import '../../css/material-buttons'; @import '../../css/inputs'; -$footer-height: 40px; - html, body { + margin: 0; + padding: 0; width: 380px; + overflow-x: hidden; + overflow-y: auto; } body { - margin: 0; - padding: 0 0 #{$footer-height+15px} 0; font-family: $roboto; color: $color-text-dark; @@ -31,7 +31,7 @@ body { box-sizing: border-box; } -header, .content, footer { +header, .content .part, footer { padding: 5px 10px; } @@ -167,10 +167,7 @@ h2 { } footer { - position: absolute; - bottom: 0; - width: 100%; - height: $footer-height; + margin-top: 20px; text-align: right; @extend .primary-color--background; @include transition-duration($timing-medium); diff --git a/data/browser-action/index.html b/data/browser-action/index.html index fa2b0f5..0551407 100644 --- a/data/browser-action/index.html +++ b/data/browser-action/index.html @@ -13,14 +13,14 @@

Material Freebox OS

-
+

Couleur primaire

    Couleur secondaire

      -
      +

      Fond d'écran (source)

        diff --git a/data/browser-action/js/script.js b/data/browser-action/js/script.js index df8872e..045c466 100644 --- a/data/browser-action/js/script.js +++ b/data/browser-action/js/script.js @@ -92,14 +92,18 @@ var primaryColor_colors = primaryColorsUl.find('li'), accentColor_colors = accentColorsUl.find('li'); - if (!MaterialFreeboxOS.environment.isFirefox()) { + if (MaterialFreeboxOS.environment.isFirefox()) { + $('body') + .attr('data-color-primary', MaterialFreeboxOS.materialColors.defaultPrimary) + .attr('data-color-accent', MaterialFreeboxOS.materialColors.defaultAccent); + } else { // Retrieve current settings chrome.storage.local.get('color-primary', function (data) { var defaultPrimaryColor = MaterialFreeboxOS.materialColors.defaultPrimary, primaryColor = data['color-primary'] || defaultPrimaryColor; primaryColor_colors.filter('[data-color="' + primaryColor + '"]').addClass('current'); - $('body').attr('data-color-primary', primaryColor) + $('body').attr('data-color-primary', primaryColor); }); chrome.storage.local.get('color-accent', function (data) { var defaultAccentColor = MaterialFreeboxOS.materialColors.defaultAccent,