Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Updated og tags. Added wait after setLink to ensure promise runs - Added a slight delay to onclick event to ensure the shortener runs before the link is executed.

ZachTRicea51caeb1bebb
diff --git a/web/index.html b/web/index.html
index 0715185ba..ad3f894f1 100644
--- a/web/index.html
+++ b/web/index.html
@@ -39,9 +39,9 @@
<meta http-equiv="Pragma" content="no-cache">
<!-- open graph for social sharing -->
- <meta property="og:title" content="EOSDIS Worldview">
+ <meta property="og:title" content="Worldview: Explore Your Dynamic Planet">
<meta property="og:image" content="images/preview.png" />
- <meta property="og:description" content="NASA's Worldview Application">
+ <meta property="og:description" content="The NASA Worldview app provides a satellite's perspective of the planet as it looks today and as it has in the past. Worldview is part of NASA’s Earth Observing System Data and Information System. EOSDIS makes the agency's large repository of data accessible and freely available to the public.">
<!-- CSS resources ==================================================== -->
diff --git a/web/js/link/wv.link.ui.js b/web/js/link/wv.link.ui.js
index a71bc3874..fb074bec4 100644
--- a/web/js/link/wv.link.ui.js
+++ b/web/js/link/wv.link.ui.js
@@ -205,15 +205,20 @@ wv.link.ui = wv.link.ui || function(models, config) {
};
// Update react link states when share buttons are clicked.
+ // Prepare link and then click to ensure shortener promise has ran.
self.clickFunction = function() {
- self.setLink(fbLink, twLink, rdLink, emailLink, self.reactComponent.updateLinkState);
- var replaceLink = function() {
- $('#permalink_content').val(models.link.get());
- $("#wv-link-shorten-check").iCheck("uncheck");
- $('#permalink_content').focus();
- $('#permalink_content').select();
- };
- setTimeout(replaceLink, 10);
+ var linkReady;
+ var waitUntil = Date.now() + 200;
+ while (Date.now() < waitUntil) {
+ if (!linkReady) {
+ linkReady = true;
+ self.setLink(fbLink, twLink, rdLink, emailLink, self.reactComponent.updateLinkState);
+ $('#permalink_content').val(models.link.get());
+ $("#wv-link-shorten-check").iCheck("uncheck");
+ $('#permalink_content').focus();
+ $('#permalink_content').select();
+ }
+ }
};
self.initWidget = function() {