Priyanka Bagade
Priyanka Bagade

Reputation: 9

Remove div when ember growl notification is hidden

We have div within ember growl notification after the notification hides with css animation after 5 sec ...on inspecting the div is still seen in the element. I want to remove this div element

  <div class="ember-growl-container">                              
     {{#ember-growl-notification-placeholder as |notification close| }}
            <div class="ember-growl-notification-item-container ember-view {{if notification.isSuccess 'ember-success' 'ember-error'}}" data-test-flash-selector={{notification.type}}>
                    {{notification.message}}
            <div class=" col-md-1 ">
                <button onclick={{action close}} class="ember-close">X</button>
            </div>
            </div>
    {{/ember-growl-notification-placeholder}}
</div>

CSS Class

.ember-success {
color: #155724;
background-color: #d4edda;
border-color: #c3e6cb;
box-shadow: 1px 1px 1px 1px;
opacity: 1;
border: 1px solid transparent;
background-image: none;
font-family: unset;
text-align: left;
font-weight: 700;
top: 10%;
box-sizing: border-box;
z-index: 5000;
padding: 9px;
display: inherit;
border-radius: 4px;
-webkit-animation: cssAnimation 0s ease-in 5s forwards;
-moz-animation: cssAnimation 0s ease-in 5s forwards;
-o-animation: cssAnimation 0s ease-in 5s forwards;
animation: cssAnimation 0s ease-in 5s forwards;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
    .ember-close {
        border: none;
        background-color: #d4edda;
        color: #155724;
    }
}

Upvotes: 0

Views: 116

Answers (1)

Trenton Trama
Trenton Trama

Reputation: 4930

I think I understand what the issue is. Using the example that ember-growl-notification has in their readme, I noticed that the auto-close feature of growl isn't triggered.

You've tried to get the hide feature back by using a css transition, but CSS doesn't actually remove an element.

Try this instead.

{{#ember-growl-notification-placeholder as |notification close| }}
    {{#ember-growl-notification-item type=notification.type timeout=notification.timeout}}
        {{notification.message}}
        <button onclick={{action close}} class="ember-close">X</button>
    {{/ember-growl-notification-item}}
{{/ember-growl-notification-placeholder}}

Upvotes: 0

Related Questions