Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Made notifications more modular

Taylor Gunnoe6d03720d53ad
diff --git a/web/css/wv.events.css b/web/css/wv.events.css
index 28efbafd3..80fe49f7b 100644
--- a/web/css/wv.events.css
+++ b/web/css/wv.events.css
@@ -16,10 +16,15 @@
}
.notify-alert i:last-child{
float: right;
- margin-left: 10px;
+ padding:0 10px;
+}
+.notify-alert i:last-child:hover {
+ cursor: pointer;
+ background: #ccc;
+ color: #333;
}
.notify-alert .ui-dialog-content {
- padding: 0 10px;
+ padding: 0 0 0 10px;
box-sizing: border-box;
line-height: 40px;
}
diff --git a/web/js/wv.events.js b/web/js/wv.events.js
index 0f9b50bd4..bcf622d69 100644
--- a/web/js/wv.events.js
+++ b/web/js/wv.events.js
@@ -111,8 +111,46 @@ wv.events = wv.events || function(models, ui) {
var $detailContainer = $("<div></div>")
.attr("id", "wv-events-detail")
.hide();
+
$panels.append($detailContainer);
+ var $message = $('<span></span>')
+ .addClass('notify-message');
+
+ var $icon = $('<i></i>')
+ .addClass('fa fa-warning fa-1x');
+
+ var $close = $('<i></i>')
+ .addClass('fa fa-times-circle-o fa-1x')
+ .click(function(e){
+ $notification.dialog( 'close' );
+ });
+
+ $notification = $('<div></div>')
+ .append( $icon)
+ .append( $message )
+ .append( $close )
+ .dialog({
+ autoOpen: false,
+ resizable: false,
+ height: 40,
+ width: 370,
+ draggable: false,
+ show: {
+ effect: "fade",
+ duration: 400
+ },
+ hide: {
+ effect: "fade",
+ duration: 200
+ },
+ dialogClass: 'no-titlebar notify-alert',
+ close: function( event, ui ) {
+ //wv.util.localStorage( 'notified', !notified );
+ notified = true;
+ }
+ });
+
$(window).resize(resize);
self.refresh();
@@ -271,47 +309,20 @@ wv.events = wv.events || function(models, ui) {
}
};
var notify = function( text ) {
+
var message = text || 'Events may not be visible ' +
'until the next day.';
- var $icon = $('<i></i>')
- .addClass('fa fa-warning')
- .addClass('fa-1x');
+ var $message = $('.notify-message');
- var $close = $('<i></i>')
- .addClass('fa fa-times-circle-o')
- .addClass('fa-1x')
- .click(function(e){
- $notification.dialog( 'close' );
- });
+ $message.empty();
+ $message.append( message );
- //$notification.clear();
+ $notification.find('i:first-child')
+ .attr('title', message);
- $notification = $('<div></div>')
- .append( $icon)
- .append( message )
- .append( $close );
-
if ( !notified ){
- $notification.dialog({
- autoOpen: true,
- resizable: false,
- height: 40,
- width: 370,
- draggable: false,
- show: {
- effect: "fade",
- duration: 400
- },
- hide: {
- effect: "fade",
- duration: 200
- },
- dialogClass: 'no-titlebar notify-alert',
- close: function( event, ui ) {
- wv.util.localStorage( 'notified', !notified );
- }
- });
+ $notification.dialog( 'open' );
}
};
var goTo = function(method, location) {