Skip to content

Commit bc6c8ad

Browse files
authored
fix(toast): dedicated horizontal container
Whenever a horizontal toast was created, all further toast, in the same container position, were shown horizontal as well, even if they were supposed to be displayed normal/vertically. Reason for this was the container selector, which was only defined for the positioning, but ignored a possible horizontal setting. This PR now creates a dedicated horizontal container, which fixes such situations.
1 parent 61f0055 commit bc6c8ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/definitions/modules/toast.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ $.fn.toast = function(parameters) {
443443
has: {
444444
container: function() {
445445
module.verbose('Determining if there is already a container');
446-
return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : '')).length > 0);
446+
return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')')).length > 0);
447447
},
448448
toast: function(){
449449
return !!module.get.toast();
@@ -458,7 +458,7 @@ $.fn.toast = function(parameters) {
458458

459459
get: {
460460
container: function() {
461-
return ($context.find(module.helpers.toClass(settings.position) + selector.container)[0]);
461+
return ($context.find(module.helpers.toClass(settings.position) + selector.container + (settings.horizontal ? module.helpers.toClass(className.horizontal) : ':not('+module.helpers.toClass(className.horizontal)+')'))[0]);
462462
},
463463
toastBox: function() {
464464
return $toastBox || null;

0 commit comments

Comments
 (0)