Merge pull request #669 from metamaps/fix/remove-invalid-links

show link remover for invalid links too
This commit is contained in:
Devin Howard 2016-09-25 23:47:30 +08:00 committed by GitHub
commit 17870e7a4c

View file

@ -72,9 +72,11 @@ const TopicCard = {
}
$('.CardOnGraph').addClass('hasAttachment')
if (self.authorizedToEdit) {
},
showLinkRemover: function() {
if (TopicCard.authorizedToEdit && $('#linkremove').length === 0) {
$('.embeds').append('<div id="linkremove"></div>')
$('#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()
}