Skip to content
Snippets Groups Projects

Resolved once error.

Open Nilesh Shah requested to merge issue/inotify-3468868:3468868-once-is-not-function into 2.0.x
3 files
+ 57
57
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 22
21
(function ($, Drupal) {
(function ($, Drupal, once) {
'use strict';
'use strict';
Drupal.behaviors.inotify = {};
Drupal.behaviors.inotify = {};
 
// Define the inotify behavior.
 
Drupal.behaviors.inotify = {
 
attach: function (context, settings) {
 
// Attach the NotificationsBlockEvents behavior.
 
once('inotify-opener-behaviors', '.inotify-opener', context).forEach(function (element) {
 
$('.inotify-block-content').toggleClass('active');
 
$('.inotify-opener .count.hidden').hide();
 
});
 
 
$('body').on('click', function (evt) {
 
if (!$(evt.target).closest('.inotify-block').length) {
 
if ($('.inotify-block-content').hasClass('active')) {
 
$('.inotify-block-content').toggleClass('active');
 
}
 
}
 
});
 
}
 
};
 
 
// Define the RefreshNotificationsView function.
Drupal.behaviors.inotify.RefreshNotificationsView = function () {
Drupal.behaviors.inotify.RefreshNotificationsView = function () {
// Find the notification view.
// Find the notification view.
$.each(Drupal.views.instances, function getInstance(index, element) {
$.each(Drupal.views.instances, function getInstance(index, element) {
@@ -15,23 +35,4 @@
@@ -15,23 +35,4 @@
});
});
};
};
Drupal.behaviors.NotificationsBlockEvents = {
})(jQuery, Drupal, once);
attach: function (context, settings) {
$('.inotify-opener').once().click(function () {
$('.inotify-block-content').toggleClass('active');
$('.inotify-opener .count').hide();
});
$('body').click(function (evt) {
if ($(evt.target).closest('.inotify-block').length) {
return;
}
else {
if ($('.inotify-block-content').hasClass('active')) {
$('.inotify-block-content').toggleClass('active')
}
}
});
}
};
})(jQuery, Drupal);
Loading