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.
14 lines
350 B
JavaScript
14 lines
350 B
JavaScript
(function() {
|
|
"use strict";
|
|
App.SocialShare = {
|
|
initialize: function() {
|
|
$(".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);
|