summaryrefslogtreecommitdiffstats
path: root/theme
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2014-08-16 17:19:39 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-17 12:03:22 -0600
commit5b9537222e2af2a8230c3805f89007c8f20e0a6d (patch)
tree4d9ba743ff05a19d8985bae470092de3ef8e4373 /theme
parent1494ea97273273ad6e5a70ab29d382d221b16988 (diff)
downloadsubsurface-5b9537222e2af2a8230c3805f89007c8f20e0a6d.tar.gz
HTML: Make theme colors consistent.
Buttons and fields colors must be consistent in different themes. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'theme')
-rw-r--r--theme/dive_export.html1
-rw-r--r--theme/list_lib.js14
2 files changed, 11 insertions, 4 deletions
diff --git a/theme/dive_export.html b/theme/dive_export.html
index fd98ba442..697c16ca3 100644
--- a/theme/dive_export.html
+++ b/theme/dive_export.html
@@ -134,6 +134,7 @@ window.onload=function(){
//translate Page
translate_page();
+ getDefaultColor();
}
function changeAdvSearch(e){
diff --git a/theme/list_lib.js b/theme/list_lib.js
index 3b8dbc4ed..0a7921823 100644
--- a/theme/list_lib.js
+++ b/theme/list_lib.js
@@ -666,13 +666,11 @@ function toggleStats()
var stats_button = document.getElementById('stats_button');
if (statsShows) {
statsShows = false;
- stats_button.style.backgroundColor = "#dfdfdf";
document.getElementById('diveListPanel').style.display = 'block';
document.getElementById('diveStat').style.display = 'none';
} else {
document.getElementById('diveListPanel').style.display = 'none';
document.getElementById('diveStat').style.display = 'block';
- stats_button.style.backgroundColor = "#5f7f8f";
statsShows = true;
showStats();
}
@@ -717,7 +715,15 @@ function stats_row_unhighlight(row)
//trips
var tripsShown;
+var HEADER_COLOR;
+var BACKGROUND_COLOR;
+function getDefaultColor(){
+ var header = document.getElementById('header');
+ var button = document.getElementById('no_dives_selector');
+ HEADER_COLOR = document.defaultView.getComputedStyle(header).getPropertyValue('background-color');
+ BACKGROUND_COLOR = document.defaultView.getComputedStyle(button).getPropertyValue('background-color');
+}
/**
*This is the main function called to show/hide trips
@@ -727,11 +733,11 @@ function toggleTrips()
var trip_button = document.getElementById('trip_button');
if (tripsShown) {
tripsShown = false;
- trip_button.style.backgroundColor = "#dfdfdf";
+ trip_button.style.backgroundColor = BACKGROUND_COLOR;
viewInPage();
} else {
showtrips();
- trip_button.style.backgroundColor = "#5f7f8f";
+ trip_button.style.backgroundColor = HEADER_COLOR;
tripsShown = true;
}
}