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

Issue #15: Support Toastr newestOnTop configuration option #16

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dist/angular-toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ angular.module('toastr', [])
function _setContainer(options) {
if(container) { return containerDefer.promise; } // If the container is there, don't create it.

container = angular.element('<div></div>');
// Inline <i> element used for new-Toast positioning (in _notify)
container = angular.element('<div><i></i></div>');
container.attr('id', options.containerId);
container.addClass(options.positionClass);
container.css({'pointer-events': 'auto'});
Expand Down Expand Up @@ -175,7 +176,9 @@ angular.module('toastr', [])
toasts.push(newToast);

_setContainer(options).then(function() {
$animate.enter(newToast.el, container, null, function() {
var after = toastrConfig.newestOnTop ? container.find('i') : null; // You could change the default

$animate.enter(newToast.el, container, after, function() {
newToast.scope.init();
});
});
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-toastr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/toastr.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ angular.module('toastr', [])
function _setContainer(options) {
if(container) { return containerDefer.promise; } // If the container is there, don't create it.

container = angular.element('<div></div>');
// Inline <i> element used for new-Toast positioning (in _notify)
container = angular.element('<div><i></i></div>');
container.attr('id', options.containerId);
container.addClass(options.positionClass);
container.css({'pointer-events': 'auto'});
Expand Down Expand Up @@ -175,7 +176,9 @@ angular.module('toastr', [])
toasts.push(newToast);

_setContainer(options).then(function() {
$animate.enter(newToast.el, container, null, function() {
var after = toastrConfig.newestOnTop ? container.find('i') : null; // You could change the default

$animate.enter(newToast.el, container, after, function() {
newToast.scope.init();
});
});
Expand Down