Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Added open function to ensure content loads from top - Overflowed jquery ui dialog defaults scrollbar to bottom of page, added check after modal opens to force scroll to top. - Removed css rule, set fixed height within dialog

ZachTRice646cc67da5c6
diff --git a/web/css/wv.layers.info.css b/web/css/wv.layers.info.css
index dacd531aa..f2c433764 100644
--- a/web/css/wv.layers.info.css
+++ b/web/css/wv.layers.info.css
@@ -10,5 +10,4 @@
*/
.layer-metadata {
- height: 200px;
}
diff --git a/web/js/layers/wv.layers.info.js b/web/js/layers/wv.layers.info.js
index bd20fb473..ed7e3d9a0 100644
--- a/web/js/layers/wv.layers.info.js
+++ b/web/js/layers/wv.layers.info.js
@@ -50,12 +50,18 @@ wv.layers.info = wv.layers.info || function(config, models, layer) {
title: names.title,
show: { effect: "slide", direction: "left" },
width: 300,
- height: "auto",
+ height: 300,
position: {
my: "left top",
at: "right+5 top",
of: $("#products")
},
+ // Wait for the dialog box to load, then force scroll to top
+ open : function () {
+ $(this).parent().promise().done(function () {
+ $('.ui-dialog-content').scrollTop('0');
+ });
+ },
close: dispose
});
};
@@ -70,6 +76,7 @@ wv.layers.info = wv.layers.info || function(config, models, layer) {
$.get('config/metadata/' + 'modis/Aerosol' + '.html')
.success(function(data) {
$layerMeta.html(data);
+ $dialog.append('<div id="tos_top"></div>');
$dialog.append( $layerMeta );
//
// $layerMeta.find('a')