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

Commit

Permalink
Merge pull request #902 from ArcRain/master
Browse files Browse the repository at this point in the history
Fix No 'panelunload' event when panel removed active
  • Loading branch information
Ian Maffett committed Nov 4, 2015
2 parents 4a92b51 + e49b8c8 commit 9c6de3f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/af.ui.js
Expand Up @@ -860,11 +860,6 @@
//Add the back button if it's not there
if(hdr.find(".backButton").length===1) return;
hdr.prepend("<a class='backButton back'>" + this.backButtonText + "</a>");
//Fix device click no response issue
hdr.on("click", ".backButton", function() {
if(this.useInternalRouting)
this.goBack(this);
});
}
else {
hdr.find(".backButton").remove();
Expand Down Expand Up @@ -971,11 +966,13 @@
if(!back){
this.classList.remove("active");
//If 'this' is view, then find active panel and remove active from it
var activePanel = $(this).find(".active").get(0);
if (undefined !== activePanel) {
activePanel.classList.remove("active");
var tmpActive = $(this).find(".active").get(0);
if (undefined !== tmpActive) {
$(tmpActive).trigger("panelunload", [back]);
tmpActive.classList.remove("active");
}
$(this).trigger("panelunload", [back]);
//Below trigger will be called when 'to animation' done
//$(this).trigger("panelunload", [back]);
}
else{
this.classList.add("active");
Expand All @@ -1001,6 +998,7 @@
//Fixes #850, #860, #873
var tmpActive = $(hide).find(".active").get(0);
if (undefined !== tmpActive) {
$(tmpActive).trigger("panelunload", [back]);
tmpActive.classList.remove("active");

}
Expand All @@ -1012,9 +1010,10 @@
}
this.classList.remove("active");
//If 'hide' is view, then find active panel and remove active from it
var activePanel = $(this).find(".active").get(0);
if (undefined !== activePanel) {
activePanel.classList.remove("active");
var tmpActive = $(this).find(".active").get(0);
if (undefined !== tmpActive) {
$(tmpActive).trigger("panelunload", [back]);
tmpActive.classList.remove("active");
}
$(hide).trigger("panelload", [back]);
$(hide).addClass("active");
Expand Down

0 comments on commit 9c6de3f

Please sign in to comment.