panel active not disabled between views
Opened this issue · 15 comments
When calling loadContent between views, the last active panel in the view stays active. There will be 2 active panels.
The panel that does not deactivate never will become deactive when transitioning between pages.
This happens by clicking a footer link <a href="#somepage".. or by using $.afui.loadContent
This was an issue posted before, and I don't think it was ever resolved. However, I did link a comment to an existing pull request posted in April #850 .
the update to af.ui.js adds to the runTransition function and removes the active class if found. it works, but it requires a transition to be set when calling the panels, and not sure if it's the best solution.
Just added the code.. works great. Thanks so much!
The side effect is that it hides the background panel when calling a panel within a modal view. Not a big deal though.. I will look into fixing that in a bit
@SeekChange @tahoetomahawk - can either of you put up demo's showing the bug and how it's resovled with that pull request/ I'll be happy to merge it.
I used the pull request code as a workaround. It's not quite a resolution
but it gets the job done for now.
Let me know if you still need a pull request, we can put together a sample.
On Mon, Jun 8, 2015 at 10:42 AM, Ian Maffett notifications@github.com
wrote:
@SeekChange https://github.com/seekchange @tahoetomahawk
https://github.com/tahoetomahawk - can either of you put up demo's
showing the bug and how it's resovled with that pull request/ I'll be happy
to merge it.—
Reply to this email directly or view it on GitHub
#873 (comment).
@tahoetomahawk - I'm fine accepting the pull request that is there. I've just been asking for demos/tests to show the error and that it has been resolved.
I will include a page with multiple views that shows the issue later this
evening.
On Mon, Jun 8, 2015 at 12:59 PM, Ian Maffett notifications@github.com
wrote:
@tahoetomahawk https://github.com/tahoetomahawk - I'm fine accepting
the pull request that is there. I've just been asking for demos/tests to
show the error and that it has been resolved.—
Reply to this email directly or view it on GitHub
#873 (comment).
@tahoetomahawk : Please upload your solution. I have tried code from #850 but problem is still there.
@imaffett : Can you please look in to this bug as this is pending from a long time & we are not able to migrate our AF2.2 apps to AF3 just because of this issue. Thanks.
@manish-stack - no one has given me demos/tests/etc
Hi guys,
I haven't uploaded tests. The work around did not work completely, I found
another issue with it. The on panel load gets triggered, but never the
unload. It looks like the bug happens with transitioning between views, not
panels.
Everything seems to work fine within the same view, but using multiple
views things start to break.
The way that headers and footers are defined at the view level forced me to
have to create multiple views. I'm redesigning my UI and creating my own
Footer I can use on certain panels so I can put everything into the same
view.
On Mon, Jul 27, 2015 at 7:32 AM, Ian Maffett notifications@github.com
wrote:
@manish-stack https://github.com/manish-stack - no one has given me
demos/tests/etc—
Reply to this email directly or view it on GitHub
#873 (comment).
Folks, this is really a huge problem we ran into. However, after including these lines from the pull request that @tahoetomahawk mentioned (where were removed in this request, for whatever reason???) at the beginning of runTransition()
in appframework.ui.js
at line 1218, it works:
if (typeof previous !== "undefined" && previous !== null) {
if(previous.find) {
setTimeout(function(){
previous.find(".active").removeClass("active");
},500);
}
}
@jdinse I appreciate it's a huge problem but look at my previous comments. Not one person has given me a demo to test against. All people say is "it doesn't work fix it".
If this fixes your case, open up a pull request and I'll merge it, but you need a demo/test to show it working.
Jay, that work around was not sufficient as the panelunload was not being
called when transitioning from 1 view to another. If you don't need
panelload or panelunload then you should be fine.
On Wed, Jul 29, 2015 at 6:49 AM, Jay Dinse notifications@github.com wrote:
Folks, this is really a huge problem we ran into. However, after including
these lines from the pull request that @tahoetomahawk
https://github.com/tahoetomahawk mentioned (where were removed in this
request, for whatever reason???) at the beginning of runTransition() in
appframework.ui.js at line 1218, it works:if (typeof previous !== "undefined" && previous !== null) { if(previous.find) { setTimeout(function(){ previous.find(".active").removeClass("active"); },500); } }
—
Reply to this email directly or view it on GitHub
#873 (comment).
@tahoetomahawk I found out that it is caused by the fifth Parameter (anchor) in function loadContent(). It changes the current view to what the anchor belongs to for the transition. Therefore it tries to unload the wrong view. Look at lines 1014 ff. in function loadDiv():
//check current view
var currentView;
if(anchor){
currentView=this.findViewTarget(anchor);
}
else
currentView=this.findViewTarget(this.activeDiv);
So the workaround for me was to not use these fifth parameter right now.
Good find, thanks!!
On Thu, Aug 27, 2015 at 3:21 AM, Jay Dinse notifications@github.com wrote:
@tahoetomahawk https://github.com/tahoetomahawk I found out that it is
caused by the fifth Parameter (anchor) in function loadContent(). It
changes the current view to what the anchor belongs to for the transition.
Therefore it tries to unload the wrong view. Look at lines 1014 ff. in
function loadDiv()://check current view var currentView; if(anchor){ currentView=this.findViewTarget(anchor); } else currentView=this.findViewTarget(this.activeDiv);
So the workaround for me was to not use these fifth parameter right now.
—
Reply to this email directly or view it on GitHub
#873 (comment).