Skip to content
Snippets Groups Projects
Commit 6b29e0da authored by Ana Pettirossi's avatar Ana Pettirossi
Browse files

Issue #3362496: Fix missing js-cookie dependency.

parent b7af2f24
No related branches found
No related tags found
1 merge request!2Issue #3362496: Missing dependency on once
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, Cookies) {
'use strict';
Drupal.behaviors.youtubeModal = {
......@@ -23,7 +23,7 @@
});
// Show/hide help blocks by cookie.
var hiddenArray = ($.cookie('AHB_hidden') !== undefined) ? $.parseJSON($.cookie('AHB_hidden')) : [];
var hiddenArray = (Cookies.get('AHB_hidden') !== undefined) ? $.parseJSON(Cookies.get('AHB_hidden')) : [];
$('.block-help-item').each(function () {
// Show if block is not in the hidden array.
if ($.inArray($(this).data('block-id'), hiddenArray) === -1 || $.inArray($(this).data('block-id'), hiddenArray) === false) {
......@@ -35,9 +35,9 @@
var block = $(this).parent();
hiddenArray.push($(block).data('block-id'));
$(block).addClass('hidden');
$.cookie('AHB_hidden', JSON.stringify(hiddenArray), {'path': '/' + drupalSettings.path.currentPath});
Cookies.set('AHB_hidden', JSON.stringify(hiddenArray), {'path': '/' + drupalSettings.path.currentPath});
});
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, window.Cookies);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment