appframework icon indicating copy to clipboard operation
appframework copied to clipboard

panel active not disabled between views

Open tahoetomahawk opened this issue 9 years ago • 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

tahoetomahawk avatar Jun 04 '15 04:06 tahoetomahawk

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.

rvacca2 avatar Jun 04 '15 06:06 rvacca2

Just added the code.. works great. Thanks so much!

tahoetomahawk avatar Jun 06 '15 16:06 tahoetomahawk

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

tahoetomahawk avatar Jun 06 '15 16:06 tahoetomahawk

@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.

imaffett avatar Jun 08 '15 17:06 imaffett

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 [email protected] 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 https://github.com/01org/appframework/issues/873#issuecomment-110089011.

tahoetomahawk avatar Jun 08 '15 19:06 tahoetomahawk

@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.

imaffett avatar Jun 08 '15 19:06 imaffett

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 [email protected] 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 https://github.com/01org/appframework/issues/873#issuecomment-110120966.

tahoetomahawk avatar Jun 08 '15 20:06 tahoetomahawk

@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 avatar Jul 24 '15 23:07 manish-stack

@manish-stack - no one has given me demos/tests/etc

imaffett avatar Jul 27 '15 14:07 imaffett

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 [email protected] 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 https://github.com/01org/appframework/issues/873#issuecomment-125226247.

tahoetomahawk avatar Jul 27 '15 16:07 tahoetomahawk

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 avatar Jul 29 '15 13:07 jdinse

@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.

imaffett avatar Jul 29 '15 13:07 imaffett

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 [email protected] 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 https://github.com/01org/appframework/issues/873#issuecomment-125958399.

tahoetomahawk avatar Jul 29 '15 13:07 tahoetomahawk

@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.

jdinse avatar Aug 27 '15 10:08 jdinse

Good find, thanks!!

On Thu, Aug 27, 2015 at 3:21 AM, Jay Dinse [email protected] 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 https://github.com/01org/appframework/issues/873#issuecomment-135373136.

tahoetomahawk avatar Aug 27 '15 13:08 tahoetomahawk