Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Demos: h2widget: Fix typo and remove a pbc handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Feb 15, 2013
1 parent 3473e25 commit 6785815
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
7 changes: 2 additions & 5 deletions docs/demos/_assets/js/h2widget.js
Expand Up @@ -12,9 +12,6 @@
}
ele = $( this );
});
$( document ).on( "pagebeforechange", function( e, f ){
f.originalHref = href;
});
$( document ).on("pagebeforechange", function( e,f ){
var hash = $.mobile.path.parseUrl(f.toPage).hash;
if( typeof hash !== "undefined" && hash.search( "/" ) === -1 && hash !== "" && $( hash ).length > 0 && !$( hash ).hasClass( "ui-page" ) && $(hash).data('role') !== "page" && !$( ".ui-page-active " + hash ).hasClass( "ui-panel" ) && !$( ".ui-page-active " + hash ).hasClass( "ui-popup" )){
Expand All @@ -23,7 +20,7 @@
$.mobile.silentScroll( pos );
$.mobile.navigate( hash, '', true );
} else if( typeof f.toPage !== "object" && hash !== "" && $.mobile.path.parseUrl( f.originalHref ).hash !== "" && !$( hash ).hasClass( "ui-page" ) && $(hash).attr('data-role') !== "page" && !$( ".ui-page-active " + hash ).hasClass( "ui-panel" ) && !$( ".ui-page-active " + hash ).hasClass( "ui-popup" )){
$( ele ).attr( href, f.originalHref );
$( ele ).attr( "href", f.originalHref );
$.mobile.document.one( "pagechange", function(){
if( typeof hash !== "undefined" && hash.search( "/" ) === -1 && hash !== "" && $( hash ).length > 0 && !$( hash ).hasClass( "ui-page" ) && $(hash).data('role') !== "page" && !$( ".ui-page-active " + hash ).hasClass( "ui-panel" ) && !$( ".ui-page-active " + hash ).hasClass( "ui-popup" )){
hash = $.mobile.path.parseUrl(f.originalHref).hash;
Expand Down Expand Up @@ -111,4 +108,4 @@
$(e.target).h2linker();
}
});
})( jQuery );
})( jQuery );
2 changes: 1 addition & 1 deletion docs/demos/_assets/js/view-source.js
Expand Up @@ -92,7 +92,7 @@ function makeButton() {

d.className = "jqm-view-source-link";

a.setAttribute( "href", "./" );
a.setAttribute( "href", "#demoPopup" );
a.setAttribute( "data-rel", "popup" );
a.setAttribute( "data-role", "button" );
a.setAttribute( "data-icon", "arrow-u" );
Expand Down
7 changes: 7 additions & 0 deletions docs/demos/widgets/controlgroups/index.html
Expand Up @@ -10,6 +10,13 @@
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,700' rel='stylesheet' type='text/css'>
<script src="../../../../js/jquery.js"></script>
<script src="../../_assets/js/"></script>
<script>
( function( $, undefined ) {
$( document ).bind( "mobileinit", function() {
$.mobile.ajaxEnabled = false;
});
})( jQuery );
</script>
<script src="../../../../js/"></script>
</head>
<body>
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/popup/index.html
Expand Up @@ -9,6 +9,13 @@

<script src="../../../js/jquery.js"></script>
<script src="../../../docs/_assets/js/jqm-docs.js"></script>
<script>
( function( $, undefined ) {
$( document ).bind( "mobileinit", function() {
$.mobile.ajaxEnabled = false;
});
})( jQuery );
</script>
<script src="../../../js/"></script>

</head>
Expand Down

1 comment on commit 6785815

@jaspermdegroot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielschulhof

View source still doesn't work if I disable AJAX globally in jqm-demo.js

Please sign in to comment.