Hi,

I have created a D8 port for this. Attached is the code.

CommentFileSizeAuthor
messageclose.zip44.79 KBnarendrar

Comments

NarendraR created an issue. See original summary.

  • derjochenmeyer committed 7a21772 on 8.x-1.x
    Issue #2913480 by NarendraR: D8 port of Status Message Close
    

derjochenmeyer’s picture

Thank you for your work NarendraR. I created a git branch out of it.

The functionality of Status Message Close depends on certain CSS IDs and classes. The following JS lines remove the wrapper DIV if there is only one message left in order to remove all extra padding and margin if there is no message left.

  var messages_left = $('#messages .section').children().size();
  if (messages_left === 1) {
    $('#messages').remove();
  }

The CSS id #messages seems to be deprecated. Bartik in Drupal 8 uses a class .messages__wrapper instead.

  var messages_left = $('.messages__wrapper).children().size();
  if (messages_left === 1) {
    $('.messages__wrapper').remove();
  }

  • derjochenmeyer committed 828f9c6 on 8.x-1.x
    Issue #2913480 by NarendraR, derjochenmeyer: Replace deprecated CSS id #...
derjochenmeyer’s picture

Title: D8 port » D8 port of Status Message Close
Version: 7.x-1.x-dev » 8.x-1.x-dev

Add 8.x-1.x-dev

derjochenmeyer’s picture

Status: Active » Needs review
derjochenmeyer’s picture

Status: Needs review » Fixed

Drupal 8.x-1.0 version released.

Thanks and credits to Narendra Rathore (NarendraR) for porting Status Message Close to Drupal 8.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.