X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ftocify%2Fjs%2Ftocify.js;fp=web%2Fmodules%2Fcontrib%2Ftocify%2Fjs%2Ftocify.js;h=b112cdae88f23020336a37dafcfbe59d7b446385;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/tocify/js/tocify.js b/web/modules/contrib/tocify/js/tocify.js new file mode 100644 index 000000000..b112cdae8 --- /dev/null +++ b/web/modules/contrib/tocify/js/tocify.js @@ -0,0 +1,41 @@ +/** + * @file + * Defines Javascript behaviors for the tocify module. + */ + +(function ($, Drupal, drupalSettings) { + + "use strict"; + + Drupal.behaviors.nodeDetailsSummaries = { + attach: function (context) { + $(".table-of-contents").once().each(function(index) { + $(this).tocify({ + theme: $(this).attr('data-theme'), + context: $(this).attr('data-context'), + selectors: $(this).attr('data-selectors'), + showAndHide: $(this).attr('data-show-and-hide'), + showEffect: $(this).attr('data-show-effect'), + showEffectSpeed: $(this).attr('data-show-effect-speed'), + hideEffect: $(this).attr('data-hide-effect'), + hideEffectSpeed: $(this).attr('data-hide-effect-speed'), + smoothScroll: $(this).attr('data-smooth-scroll'), + scrollTo: $(this).attr('data-scroll-to'), + showAndHideOnScroll: $(this).attr('data-show-and-hide-on-scroll'), + highlightOnScroll: $(this).attr('data-highlight-on-scroll'), + highlightOffset: $(this).attr('data-highlight-offset'), + extendPage: $(this).attr('data-extend-page'), + extendPageOffset: $(this).attr('data-extend-page-offset'), + history: $(this).attr('data-history'), + hashGenerator: $(this).attr('data-hash-generator'), + highlightDefault: $(this).attr('data-highlight-default'), + ignoreSelector: $(this).attr('data-ignore-selector'), + scrollHistory: $(this).attr('data-scroll-history') + }).parent().parent() + .css('overflow', 'auto') + .css('height', '80%'); + }); + } + }; + +})(jQuery, Drupal, drupalSettings);