Browse Source

fixed toc js

dependabot/npm_and_yarn/ini-1.3.7
rdrew 4 years ago
parent
commit
2fefa4fa22
  1. 39
      js/js.js
  2. 31
      src/js/js.js

39
js/js.js

@ -2,21 +2,6 @@
Drupal.behaviors.footnote_popups = { Drupal.behaviors.footnote_popups = {
attach: function attach(context, settings) { attach: function attach(context, settings) {
/*
//target he footnotes list
$.each($(".footnote-list ul.footnotes a"), function(index, value) {
//find the footnotes at the bottom and extract the text
var _footnoteText_ = $(this).siblings(".endnote-text").text();
//var _bibCiteText_ = $(this).siblings(".endnote-text").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($(".footnote-list ul.footnotes a"), function(index, value) { $.each($(".footnote-list ul.footnotes a"), function(index, value) {
//find the footnotes at the bottom and extract the text //find the footnotes at the bottom and extract the text
@ -35,20 +20,6 @@
//use the id to fing the links href and insert the text from the 1st var //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', ''); $('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();
//console.log(_footnoteText_);
////find the href of the related anchor from the id of this
//var _id_ = $('.footnote-link', 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', '');
//});
} }
}; };
@ -83,14 +54,6 @@
}; };
Drupal.behaviors.article_collection_copier = {
attach: function attach(context, settings) {
$('.field--name-field-collection').appendTo("#toc-sections ol");
}
};
Drupal.behaviors.article_keyword_copier = { Drupal.behaviors.article_keyword_copier = {
attach: function attach(context, settings) { attach: function attach(context, settings) {
@ -114,7 +77,7 @@
attach: function attach(context, settings) { attach: function attach(context, settings) {
$('.toc a').on('click',function(e) { $('.toc li a').on('click',function(e) {
e.preventDefault(); e.preventDefault();
var offset = 100; var offset = 100;
var target = this.hash; var target = this.hash;

31
src/js/js.js

@ -2,21 +2,6 @@
Drupal.behaviors.footnote_popups = { Drupal.behaviors.footnote_popups = {
attach: function attach(context, settings) { attach: function attach(context, settings) {
/*
//target he footnotes list
$.each($(".footnote-list ul.footnotes a"), function(index, value) {
//find the footnotes at the bottom and extract the text
var _footnoteText_ = $(this).siblings(".endnote-text").text();
//var _bibCiteText_ = $(this).siblings(".endnote-text").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($(".footnote-list ul.footnotes a"), function(index, value) { $.each($(".footnote-list ul.footnotes a"), function(index, value) {
//find the footnotes at the bottom and extract the text //find the footnotes at the bottom and extract the text
@ -35,20 +20,6 @@
//use the id to fing the links href and insert the text from the 1st var //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', ''); $('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();
//console.log(_footnoteText_);
////find the href of the related anchor from the id of this
//var _id_ = $('.footnote-link', 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', '');
//});
} }
}; };
@ -106,7 +77,7 @@
attach: function attach(context, settings) { attach: function attach(context, settings) {
$('.toc a').on('click',function(e) { $('.toc li a').on('click',function(e) {
e.preventDefault(); e.preventDefault();
var offset = 100; var offset = 100;
var target = this.hash; var target = this.hash;

Loading…
Cancel
Save