diff --git a/js/js.js b/js/js.js index ca6b54d..1562c20 100644 --- a/js/js.js +++ b/js/js.js @@ -2,7 +2,8 @@ Drupal.behaviors.footnote_popups = { attach: function attach(context, settings) { - $.each($("ul.footnotes a"), function(index, value) { + //target he footnotes list + $.each($(".notes ul.footnotes a"), function(index, value) { //find the footnotes at the bottom and extract the text var _footnoteText_ = $(this).siblings(".endnote-text").text(); console.log(_footnoteText_); @@ -12,6 +13,22 @@ //use the id to fing the links href and insert the text from the 1st var $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', ''); }); + + + $.each($(".works_cited ul.footnotes a"), function(index, value) { + //find the footnotes at the bottom and extract the text + var _footnoteText_ = $(this).siblings(".bibcite-citation").text(); + console.log(_footnoteText_); + //find the href of the related anchor from the id of this + var _id_ = $(this).attr("id"); + console.log(_id_); + //use the id to fing the links href and insert the text from the 1st var + $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', ''); + }); + + + + //$.each($("li.footnote"), function(index, value) { ////find the footnotes at the bottom and extract the text //var _footnoteText_ = $(value).text(); diff --git a/src/js/js.js b/src/js/js.js index ca6b54d..1562c20 100644 --- a/src/js/js.js +++ b/src/js/js.js @@ -2,7 +2,8 @@ Drupal.behaviors.footnote_popups = { attach: function attach(context, settings) { - $.each($("ul.footnotes a"), function(index, value) { + //target he footnotes list + $.each($(".notes ul.footnotes a"), function(index, value) { //find the footnotes at the bottom and extract the text var _footnoteText_ = $(this).siblings(".endnote-text").text(); console.log(_footnoteText_); @@ -12,6 +13,22 @@ //use the id to fing the links href and insert the text from the 1st var $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', ''); }); + + + $.each($(".works_cited ul.footnotes a"), function(index, value) { + //find the footnotes at the bottom and extract the text + var _footnoteText_ = $(this).siblings(".bibcite-citation").text(); + console.log(_footnoteText_); + //find the href of the related anchor from the id of this + var _id_ = $(this).attr("id"); + console.log(_id_); + //use the id to fing the links href and insert the text from the 1st var + $('a[href$="' + _id_ + '"]').attr('data-toggle', 'tooltip').attr('data-original-title', _footnoteText_).attr('title', ''); + }); + + + + //$.each($("li.footnote"), function(index, value) { ////find the footnotes at the bottom and extract the text //var _footnoteText_ = $(value).text();