Better Messages only work for the first ajax call

Created on 29 January 2016, almost 9 years ago
Updated 11 July 2024, 4 months ago

Hi,
Just a note to help with ajax and better messages, it is working only for the first ajax call then messages are not displayed in next ajax calls because we still have the element with the class "better-messeges-processed" in the DOM.
My quick fix was to remove the element after the popup is closed :

It would be great to have this added and to add a parameter for the delay (or use "betterMessages.popout.duration" but it needs to be transformed (as it can be "fast", etc.)

In better_messages.js :

betterMessages.close = function() {
  switch (betterMessages.popout.effect) {
    case 'fadeOut':	message_box.fadeOut(betterMessages.popout.duration);
      break;
    case 'slideUp':	message_box.slideUp(betterMessages.popout.duration);
      break;
    default: message_box.fadeOut(betterMessages.popout.duration);
      break;
  }
  // Modification 2016 01 29 : remove to allow next ajax actions to popup messages
  // message_box.addClass("better-messeges-processed");
  setTimeout(function() {
    message_box.remove();
  }, 1000); // new conf needed for that ?
  // End Modification 2016 01 29
}

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Javascript

Created by

πŸ‡«πŸ‡·France grougy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024