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

Fix No 'panelunload' event when panel removed active #902

Merged
merged 3 commits into from
Nov 4, 2015
Merged
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
23 changes: 11 additions & 12 deletions src/af.ui.js
Original file line number Diff line number Diff line change
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