Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message doesn't fully disappear #34

Open
unoriginalscreenname opened this issue Jun 11, 2014 · 7 comments
Open

Message doesn't fully disappear #34

unoriginalscreenname opened this issue Jun 11, 2014 · 7 comments

Comments

@unoriginalscreenname
Copy link

Hey, great little service! I did notice that the message continues to take up space in the dom after it is 'closed'. This seems to be because inside the directive you are leaving the message object on the scope instead of clearing it out.

If you add $scope.flash = {} to the flash-directive on line 26 it'll fix it.

            $scope.hide = function () {
                removeAlertClasses();
                if (!isBlank(attr.activeClass)) {
                    element.removeClass(attr.activeClass);
                }
                $scope.flash = {};
            };
@lubosdz
Copy link

lubosdz commented Jun 18, 2014

Yes, this is true, there is a bug and the solution above will fix it. Unfortunatelly, if there is a close-button <button ....>

<div flash-alert active-class="in" duration="0">
     <button type="button" class="close" ng-click="hide()">&times;</button>
     <span class="alert-message">{{flash.message}}</span>
</div>

then button won't disappear too :-)

@wmluke
Copy link
Owner

wmluke commented Jun 22, 2014

Hi @ericmcgregor,

Have you tried out https://github.com/wmluke/angular-flash#styling-considerations to resolve the visibility issues?

Thanks,
Luke

@lubosdz
Copy link

lubosdz commented Jun 23, 2014

I was trying to use styling considerations with "alert in" classes, but did not work for me. Or I missed something perhaps... Actually, in the examples, there is no hiding CSS styling (something like alert .close {display: none} or similar) - so I'd say it's either incomplete or not really functional.

@leoetlino
Copy link

It doesn't really work, indeed. The dismissed alert still takes up place for an unknown reason; the classes seem correct though.

@caiges
Copy link

caiges commented Aug 27, 2014

@ericmcgregor You could also set the display CSS property on the flash message container to "none" and then set the "active class" ("in" by default) display property to "block", "inline", etc.. Then you wouldn't have to add code to clear flash.message.

@fernandomantoan
Copy link

Same behavior here, @ericmcgregor solution works for me!

@tobidelius
Copy link

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants