Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

Commit

Permalink
Fix issue with active panel being hidden on some animations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Maffett committed Nov 3, 2015
1 parent 49316a8 commit 9ad4b8c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/af.ui.js
Expand Up @@ -981,31 +981,27 @@
that.doingTransition=false;
}).run(transition+"-out");
}
else {
if(!back){
//If 'hide' is view, then find active panel and remove active from it
var activePanel = $(hide).find(".active").get(0);
if (undefined !== activePanel) {
activePanel.classList.remove("active");
}
$(hide).trigger("panelunload", [back]);
}
else{
$(hide).trigger("panelload", [back]);
$(hide).addClass("active");
}
}

var to=$(show).animation().remove(transition+"-out");
if(back) {
to.reverse();
}
to.end(function(){

that.doingTransition=false;
if(!back){
this.classList.add("active");
$(this).trigger("panelload", [back]);
$(noTrans).trigger("panelload", [back]);

//Previous panel needs to be hidden after animation
//Fixes #850, #860, #873
var tmpActive = $(hide).find(".active").get(0);
if (undefined !== tmpActive) {
tmpActive.classList.remove("active");

}
$(hide).trigger("panelunload", [back]);
}
else{
if(noTrans){
Expand All @@ -1017,8 +1013,11 @@
if (undefined !== activePanel) {
activePanel.classList.remove("active");
}
$(hide).trigger("panelload", [back]);
$(hide).addClass("active");
$(this).trigger("panelunload", [back]);
}

}).run(transition+"-in");
},

Expand Down

0 comments on commit 9ad4b8c

Please sign in to comment.