Remove description for screen readers

It was being duplicated when restoring a page by using browser
history. With this solution we will avoid to have screen readers
descriptions more than once inside any sociual share button.
This commit is contained in:
Senén Rodero Rodríguez
2020-07-27 12:53:33 +02:00
parent 6b17452bd5
commit 137e0f5a64
3 changed files with 16 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ var destroy_non_idempotent_modules = function() {
App.Datepicker.destroy();
App.HTMLEditor.destroy();
App.LegislationAnnotatable.destroy();
App.SocialShare.destroy();
};
$(document).on("turbolinks:load", initialize_modules);

View File

@@ -5,6 +5,9 @@
$(".social-share-button a").each(function() {
$(this).append("<span class='show-for-sr'>" + ($(this).data("site")) + "</span>");
});
},
destroy: function() {
$(".social-share-button a .show-for-sr").remove();
}
};
}).call(this);