Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

added styling to active feed items #230

Benjamin63e9daa67cab
diff --git a/web/css/wv.alert.css b/web/css/wv.alert.css
index afee34f70..2b237eb5f 100644
--- a/web/css/wv.alert.css
+++ b/web/css/wv.alert.css
@@ -21,13 +21,22 @@
.ui-menu-item.gift {
background: #40a9db
}
-.wv-notify-modal {}
+.wv-notify-modal {
+ padding:0 20px;
+}
.wv-notify-modal h2 {
+ text-transform: capitalize;
font-size: 18px;
font-family: "Lucida Sans", "Arial", Sans-Serif;
font-weight: bold;
color: #eee;
- margin: .75em 0;
+ padding: .75em 10px;
+ }
+ .wv-notify-modal .outage h2 {
+ background: rgba(179, 41, 43, .3);
+ }
+ .wv-notify-modal .alert h2 {
+ background: rgba(229, 201, 55, .3);
}
.wv-notify-modal h2 span {
font-size: 13px;
@@ -38,9 +47,14 @@
font-family: "helvetica",sans-serif;
font-size: 16px;
line-height: 22px;
- margin-bottom: 10px;
+ margin: 10px 20px;
}
-.wv-dialog .wv-notify-modal ul li{
- list-style-type: none;
- border-bottom: 1px solid #404040;
- }
\ No newline at end of file
+.wv-dialog .wv-notify-modal ul {
+ margin: 0;
+ padding: 0;
+}
+.wv-dialog .wv-notify-modal ul li {
+ list-style-type: none;
+ border-bottom: 1px solid #404040;
+ margin: 0;
+}
\ No newline at end of file
diff --git a/web/js/notifications/wv.notifications.ui.js b/web/js/notifications/wv.notifications.ui.js
index 524e0e43a..546736043 100644
--- a/web/js/notifications/wv.notifications.ui.js
+++ b/web/js/notifications/wv.notifications.ui.js
@@ -118,7 +118,7 @@ wv.notifications.ui = wv.notifications.ui || function(models, config) {
fieldValueMatches = false;
if(fieldExists) {
- fieldValueMatches = wv.util.localStorageValueMatches(type, idString);
+ fieldValueMatches = localStorageValueMatches(type, idString);
}
return fieldValueMatches;
};
@@ -318,8 +318,8 @@ wv.notifications.ui = wv.notifications.ui || function(models, config) {
}
dimensions = getModalDimensions();
- $notifyContent.append(create$block(sortedNotifications.outages, 'Outage'));
- $notifyContent.append(create$block(sortedNotifications.alerts, 'Alert'));
+ $notifyContent.append(create$block(sortedNotifications.outages, 'outage'));
+ $notifyContent.append(create$block(sortedNotifications.alerts, 'alert'));
$dialog = wv.ui.getDialog().append($notifyContent);
$dialog.dialog({
@@ -364,17 +364,26 @@ wv.notifications.ui = wv.notifications.ui || function(models, config) {
* @returns {Object} Jquery ul element
*/
var create$block = function(arra, title) {
- var $li, date, $ul = $('<ul></ul>');
+ var $li, date, activeClass, $ul = $('<ul></ul>');
for(var i = 0, len = arra.length; i < len; i++) {
+ activeClass = '';
+ if(activeNotifications[title] && i === 0) {
+ activeClass = title;
+ }
date = new Date(arra[i].created_at);
date = date.getDate()+ " " + wv.util.giveMonth(date) + " " + date.getFullYear();
- $li = $("<li><div><h2>" + title + "<span> Posted "+ date + "</span></h2><p>" + arra[i].message +"</p></div></li>");
+ $li = $("<li><div class='" + activeClass + "'><h2> <i class='fa fa-" + classes[title] + "'/> " + title + "<span> Posted "+ date + "</span></h2><p>" + arra[i].message +"</p></div></li>");
$ul.append($li);
}
return $ul;
};
+ var localStorageValueMatches = function(property, value) {
+ var oldValue = localStorage.getItem(property);
+ return oldValue === value;
+ };
+
/*
* Creates a Feed containing most recent message
*
diff --git a/web/js/util/wv.util.js b/web/js/util/wv.util.js
index 9555f64c4..7d051bdc8 100644
--- a/web/js/util/wv.util.js
+++ b/web/js/util/wv.util.js
@@ -615,10 +615,6 @@ wv.util = (function(self) {
self.isInLocalStorage = function(property) {
return localStorage.getItem(property);
};
- self.localStorageValueMatches = function(property, value) {
- var oldValue = localStorage.getItem(property);
- return oldValue === value;
- };
/**
* Wraps a function in a try/catch block that invokes wv.util.error
* if an exception is thrown.