Fix problem when using asp:ScriptManager to add scripts #45

Merged
merged 4 commits into from Sep 26, 2012

Conversation

Projects
None yet
2 participants
@hklemp
Contributor

hklemp commented Sep 13, 2012

Fix problem when using asp:ScriptManager to add scripts.
The asp:ScriptManager includes the js script at the top of the Document.
So the multiview was triggerd before the wrapper was load.

hklemp and others added some commits Sep 5, 2012

hklemp
Trigger Plugin only when Documetn Full Loaded
Fix Problem when using asp:ScriptManager to add scripts
Update JQM
Update JQM to 1.2.0 RC 1
Add fix from 1.1.1
Add fix from 1.1.1
Demo pages
Add some Demo pages
@frequent

This comment has been minimized.

Show comment Hide comment
@frequent

frequent Sep 26, 2012

Owner

Ok. I'm trying this. I'm chasing the opposite problem = multiview not firing at all sometimes. Maybe this fixes it. I'm working on the JQM 1.2 version. Will commit including your PR once I'm done and JQM 1.2 is out.

Owner

frequent commented Sep 26, 2012

Ok. I'm trying this. I'm chasing the opposite problem = multiview not firing at all sometimes. Maybe this fixes it. I'm working on the JQM 1.2 version. Will commit including your PR once I'm done and JQM 1.2 is out.

frequent added a commit that referenced this pull request Sep 26, 2012

Merge pull request #45 from hklemp/master
Fix problem when using asp:ScriptManager to add scripts

@frequent frequent merged commit 890805b into frequent:master Sep 26, 2012

@frequent

This comment has been minimized.

Show comment Hide comment
@frequent

frequent Sep 26, 2012

Owner

@hklemp: you are not taking into account if an application is made up of multiple wrapper pages.

Multiview is running in a single instance, so it triggers on the first wrapper page encountered. Once it's running it will intercept all other wrapper pages coming along. Using your commit, multiview is re-triggered with every wrapper page you visit. If I keep the wrapper pages in the DOM (there will always be two minimum when navigating around), multiview is pretty much on auto-fire.

Still - the pageinit should be there. Need to find another way of adding it.

Works using this.

$(document).bind('pageinit', function(event) {
    console.log("trigger");
    if ( !$('html').hasClass("mv-on") ){
        console.log("fire");
        $('html').addClass("mv-on");
        $('div:jqmData(wrapper="true")').multiview();
        }
    });

Doing it like this would work, but if you are using a asynloader (requireJS for example), all Jquery Mobile controlgroups will break. This is because the controlgroup-widget is triggered differently than all other widgets (see my issue 4773). So pick your poison...

Owner

frequent commented Sep 26, 2012

@hklemp: you are not taking into account if an application is made up of multiple wrapper pages.

Multiview is running in a single instance, so it triggers on the first wrapper page encountered. Once it's running it will intercept all other wrapper pages coming along. Using your commit, multiview is re-triggered with every wrapper page you visit. If I keep the wrapper pages in the DOM (there will always be two minimum when navigating around), multiview is pretty much on auto-fire.

Still - the pageinit should be there. Need to find another way of adding it.

Works using this.

$(document).bind('pageinit', function(event) {
    console.log("trigger");
    if ( !$('html').hasClass("mv-on") ){
        console.log("fire");
        $('html').addClass("mv-on");
        $('div:jqmData(wrapper="true")').multiview();
        }
    });

Doing it like this would work, but if you are using a asynloader (requireJS for example), all Jquery Mobile controlgroups will break. This is because the controlgroup-widget is triggered differently than all other widgets (see my issue 4773). So pick your poison...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment