From 8c16c60554d6cd50419c0ca8321b463dceb63052 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sun, 25 Sep 2016 22:44:07 +0800 Subject: [PATCH] show link remover for invalid links too --- frontend/src/Metamaps/TopicCard.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/Metamaps/TopicCard.js b/frontend/src/Metamaps/TopicCard.js index dad58565..68061d96 100644 --- a/frontend/src/Metamaps/TopicCard.js +++ b/frontend/src/Metamaps/TopicCard.js @@ -72,9 +72,11 @@ const TopicCard = { } $('.CardOnGraph').addClass('hasAttachment') - if (self.authorizedToEdit) { + }, + showLinkRemover: function() { + if (TopicCard.authorizedToEdit && $('#linkremove').length === 0) { $('.embeds').append('
') - $('#linkremove').click(self.removeLink) + $('#linkremove').click(TopicCard.removeLink) } }, removeLink: function () { @@ -151,6 +153,7 @@ const TopicCard = { loader.setRange(0.9); // default is 1.3 loader.show() // Hidden by default var e = embedly('card', document.getElementById('embedlyLink')) + self.showLinkRemover() if (!e) { self.handleInvalidLink() }