-
Notifications
You must be signed in to change notification settings - Fork 6.7k
openedClass not removed when close/dismiss with 2 pop-ups #4184
Comments
For reference, some conversation is in #4171. |
Even if you have 3 pop-ups they should use 3 different classes which should be removed not toggled. |
if(openedWindows.length() == 0) {
body.removeClass(modalWindow.openedClass || OPENED_MODAL_CLASS);
} Just maybe. |
It is more complicated than that - a separate data structure is likely necessary to store the class list, since there is the possibility that someone used the same custom class in multiple modals. |
Ye only way it can work with storing those classes and counting them maybe. Or you have openedWindows with length() function, u got already all opened windows list in there, so method like openedWindows.removeableClass(modalWindow.openedClass)
Which checks count of classes if count > 0 you can removed it. Should look like this.
2680 line : body.addClass(modal.openedClass || OPENED_MODAL_CLASS); should be changed to ->
modal.openedClass = modal.openedClass || OPENED_MODAL_CLASS;
body.addClass(modal.openedClass);
removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() {
if(openedWindows.removeableClass(modalWindow.openedClass)){
body.removeClass(modalWindow.openedClass);
}
});
$$stackedMap factory
removeableClass : function(class) {
var count = 0;
for(var index in stack) {
if(stack[index].value.openedClass == class) {
count++;
}
if(count > 1) break;
}
return count == 0;
} Just my opinion and example. |
So any progress ? |
Not yet, but I did not forget about this issue - I'm a busy person, but I will make sure to get a fix before we release 0.13.4, so don't worry unless I break that promise :) . |
Like for you, waiting for new version!! |
I have problem, one case like you have 2 opened pop-ups and i got 2 body classes ' class="modal-scrollable modal-open" ' when I close pop-up with modal-open class, class is not toggled
The text was updated successfully, but these errors were encountered: