mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Merge remote branch 'origin/master'
This commit is contained in:
commit
ec8a9cfed4
2 changed files with 45 additions and 36 deletions
|
|
@ -1,28 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
|
||||
<title>jQuery Mobile Framework - Dialog Example</title>
|
||||
<link rel="stylesheet" href="../../themes/default/" />
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
|
||||
<title>jQuery Mobile Framework - Dialog Example</title>
|
||||
<link rel="stylesheet" href="../../themes/default/" />
|
||||
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
|
||||
<script type="text/javascript" src="../../js/jquery.js"></script>
|
||||
<script type="text/javascript" src="../../js/"></script>
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div data-role="page">
|
||||
|
||||
|
||||
|
||||
<div data-role="content" data-theme="b">
|
||||
<p>Flickr upload:</p>
|
||||
<h3>Photos posted successfully</h3>
|
||||
|
||||
<a href="docs-dialogs.html" data-role="button" data-rel="back" data-theme="b">View photo page</a>
|
||||
<a href="docs-dialogs.html" data-role="button" data-rel="back" data-theme="c">Done</a>
|
||||
|
||||
<a href="docs-dialogs.html" data-role="button" data-theme="b">View photo page</a>
|
||||
<a href="docs-dialogs.html" data-role="button" data-theme="c">Done</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -684,6 +684,9 @@
|
|||
});
|
||||
|
||||
|
||||
//temporary fix for allowing 3rd party onclick handlers to still function.
|
||||
var preventClickDefault = false, stopClickPropagation = false;
|
||||
|
||||
//click routing - direct to HTTP or Ajax, accordingly
|
||||
$( "a" ).live( "vclick", function(event) {
|
||||
|
||||
|
|
@ -726,10 +729,14 @@
|
|||
//if data-ajax attr is set to false, use the default behavior of a link
|
||||
hasAjaxDisabled = $this.is( ":jqmData(ajax='false')" );
|
||||
|
||||
//reset our prevDefault value because I'm paranoid.
|
||||
preventClickDefault = stopClickPropagation = false;
|
||||
|
||||
//if there's a data-rel=back attr, go back in history
|
||||
if( $this.is( ":jqmData(rel='back')" ) ){
|
||||
window.history.back();
|
||||
return false;
|
||||
preventClickDefault = stopClickPropagation = true;
|
||||
return;
|
||||
}
|
||||
|
||||
//prevent # urls from bubbling
|
||||
|
|
@ -742,6 +749,7 @@
|
|||
//3rd party onclick handlers get triggered. If and when
|
||||
//a mouse click event is generated, our live("click") handler
|
||||
//will get triggered and do the preventDefault.
|
||||
preventClickDefault = true;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -756,29 +764,36 @@
|
|||
//use default click handling
|
||||
return;
|
||||
}
|
||||
else {
|
||||
//use ajax
|
||||
var transition = $this.jqmData( "transition" ),
|
||||
direction = $this.jqmData("direction"),
|
||||
reverse = (direction && direction === "reverse") ||
|
||||
// deprecated - remove by 1.0
|
||||
$this.jqmData( "back" );
|
||||
|
||||
//this may need to be more specific as we use data-rel more
|
||||
nextPageRole = $this.attr( "data-" + $.mobile.ns + "rel" );
|
||||
//use ajax
|
||||
var transition = $this.jqmData( "transition" ),
|
||||
direction = $this.jqmData("direction"),
|
||||
reverse = (direction && direction === "reverse") ||
|
||||
// deprecated - remove by 1.0
|
||||
$this.jqmData( "back" );
|
||||
|
||||
//if it's a relative href, prefix href with base url
|
||||
if( path.isRelative( url ) && !hadProtocol ){
|
||||
url = path.makeAbsolute( url );
|
||||
}
|
||||
//this may need to be more specific as we use data-rel more
|
||||
nextPageRole = $this.attr( "data-" + $.mobile.ns + "rel" );
|
||||
|
||||
url = path.stripHash( url );
|
||||
|
||||
$.mobile.changePage( url, transition, reverse);
|
||||
//if it's a relative href, prefix href with base url
|
||||
if( path.isRelative( url ) && !hadProtocol ){
|
||||
url = path.makeAbsolute( url );
|
||||
}
|
||||
event.preventDefault();
|
||||
|
||||
url = path.stripHash( url );
|
||||
|
||||
$.mobile.changePage( url, transition, reverse);
|
||||
preventClickDefault = true;
|
||||
});
|
||||
|
||||
$( "a" ).live( "click", function(event) {
|
||||
if (preventClickDefault){
|
||||
event.preventDefault();
|
||||
}
|
||||
if (stopClickPropagation){
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
//hashchange event handler
|
||||
$window.bind( "hashchange", function( e, triggered ) {
|
||||
|
|
@ -831,10 +846,4 @@
|
|||
}
|
||||
});
|
||||
|
||||
$( "a" ).live( "click", function(event) {
|
||||
//preventDefault for links that are purely for interaction
|
||||
if ($(this).is("a[href='#']")){
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
|
|||
Loading…
Reference in a new issue