1/** 2 * @file 3 * Defines the behavior bookmark behaviors. 4 */ 5 6(function ($, Drupal, drupalSettings) { 7 "use strict"; 8 9 /** 10 * Displays the bookmark sidebar. 11 */ 12 $.fn.jcdecauxBookmarkDisplaySidebar = function (content) { 13 $('#bookmark__sidebar-wrapper').addClass('active'); 14 $('body').addClass('open-bookmark'); 15 }; 16 17 /** 18 * Displays the bookmark sidebar. 19 */ 20 $.fn.jcdecauxBookmarkDisplayCheckoutSidebar = function (content) { 21 $('#bookmark__checkout-sidebar-wrapper').addClass('active'); 22 }; 23 24 /** 25 * Closes the bookmark sidebar. 26 */ 27 $.fn.jcdecauxBookmarkCloseSidebar = function () { 28 $('#bookmark__sidebar-wrapper').empty(); 29 $('#bookmark__sidebar-wrapper').removeClass('active'); 30 $('body').removeClass('open-bookmark'); 31 }; 32 33 /** 34 * Displays the floating bookmark button. 35 */ 36 Drupal.behaviors.jcdecauxBookmarkGetButton = { 37 attach: function (context) { 38 $(window).on('load', function () { 39 drupalSettings.nothrob = true; 40 41 if (drupalSettings.floating_button_visibility) { 42 $(once('autoClick', '.bookmark__floating-trigger', context)).trigger('click'); 43 } 44 45 drupalSettings.nothrob = false; 46 }); 47 48 var $sidebarWrapper = $('#bookmark__sidebar-wrapper'); 49 50 $(once('sidebar-item-title', '.bookmark__sidebar-item-title a, .bookmark__sidebar-list-item .img-wrapper a')).each(function () { 51 var $this = $(this); 52 $this.click(function(e) { 53 $sidebarWrapper.empty(); 54 $sidebarWrapper.removeClass('active'); 55 $('body').removeClass('open-bookmark'); 56 57 setTimeout(function () { 58 if (location.href.indexOf("#") !== -1) { 59 var urlHash = window.location.href.split("#")[1]; 60 61 if ($('body').hasClass('toolbar-horizontal')) { 62 $('html,body').animate({ 63 scrollTop: $('.' + urlHash + ', #' + urlHash +',[name='+urlHash+']').first().offset().top -270 64 }, 200); 65 } 66 else { 67 $('html,body').animate({ 68 scrollTop: $('.' + urlHash + ', #' + urlHash +',[name='+urlHash+']').first().offset().top -210 69 }, 200); 70 } 71 } 72 }, 100); 73 }) 74 }); 75 } 76 }; 77 78}(jQuery, Drupal, drupalSettings));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.