Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

added throttle to linkGenerating #139

Benjamin9268edaaa578
diff --git a/web/js/link/wv.link.ui.js b/web/js/link/wv.link.ui.js
index f07e0fe9c..eeeabd211 100644
--- a/web/js/link/wv.link.ui.js
+++ b/web/js/link/wv.link.ui.js
@@ -130,6 +130,12 @@ wv.link.ui = wv.link.ui || function(models, config) {
// Render Dialog Box Content
self.reactComponent = ReactDOM.render(Widget, $dialog[0]);
+ var throttleShareLinks = _.throttle(function() {
+ self.setShareLinks(self.updateShareLink);
+ }, 2000, {
+ leading: true,
+ trailing: true
+ });
// If selected during the animation, the cursor will go to the
// end of the input box
var updateLink = function() {
@@ -137,7 +143,7 @@ wv.link.ui = wv.link.ui || function(models, config) {
$("#wv-link-shorten-check").iCheck("uncheck");
$('#permalink_content').focus();
$('#permalink_content').select();
- self.setShareLinks(self.updateShareLink);
+ throttleShareLinks();
};
models.link.events.on("update", updateLink);