Skip to content

Commit 5a7377a

Browse files
committed
Temporarily removed fetchlink fade transition, added call to listview('refresh') if target element is a listview.
1 parent bea0480 commit 5a7377a

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

docs/pages/fetchlinks/fetch-tabs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<div data-role="page">
1818
<div data-role="content">
1919
<style>
20-
#quote-viewer { padding:15px; }
20+
#quote-viewer { padding: 10px 20px 10px 10px; position: relative; }
2121
#quote-viewer blockquote { font-size:1.8em; font-family:Georgia, Serif; margin:0.3em; line-height:125%; }
22-
#quote-viewer em { float:right; margin:1.2em 10%; opacity:0.5; font-size:1.1em; text-transform:uppercase; }
22+
#quote-viewer em { display: block; text-align: right; margin:1.2em 10%; opacity:0.5; font-size:1.1em; text-transform:uppercase; }
2323
#quote-viewer p { margin:2px 6px; color:#999; }
24-
#quote-viewer .quote-close { float:left; margin-top:15px; }
24+
#quote-viewer .quote-close { position: absolute; top: 0; right: 0;}
2525

2626
.pix-wrapper p { }
2727
.pix-wrapper .pix-nav { float:left; opacity:0.85; }

docs/pages/fetchlinks/pix-1.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>jQuery Mobile Framework - Fetch links</title>
77
<link rel="stylesheet" href="../../../css/themes/default/" />
88
<link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
9-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
9+
<script src="../../../js/jquery.js"></script>
1010
<script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
1111
<script src="../../_assets/js/jqm-docs.js"></script>
1212
<script src="../../../js/"></script>
@@ -26,8 +26,8 @@
2626
<h3>Alone at the beach</h3>
2727

2828
<div data-role="controlgroup" data-type="horizontal" class="pix-nav">
29-
<a href="pix-6.html" data-role="button" data-target=".pix-wrapper" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-l">Last</a>
30-
<a href="pix-2.html" data-role="button" data-target=".pix-wrapper" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-r" data-iconpos="right">Next</a>
29+
<a href="pix-6.html" data-role="button" data-target="#pix-target" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-l">Last</a>
30+
<a href="pix-2.html" data-role="button" data-target="#pix-target" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-r" data-iconpos="right">Next</a>
3131
</div>
3232
</div>
3333

docs/pages/fetchlinks/pix-2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<h3>Flower patch</h3>
2727

2828
<div data-role="controlgroup" data-type="horizontal" class="pix-nav">
29-
<a href="pix-1.html" data-role="button" data-target=".pix-wrapper" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-l">Last</a>
30-
<a href="pix-3.html" data-role="button" data-target=".pix-wrapper" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-r" data-iconpos="right">Next</a>
29+
<a href="pix-1.html" data-role="button" data-target="#pix-target" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-l">Last</a>
30+
<a href="pix-3.html" data-role="button" data-target="#pix-target" data-fragment=".pix-wrapper" id="pix-link" data-icon="arrow-r" data-iconpos="right">Next</a>
3131
</div>
3232
</div>
3333

js/jquery.mobile.fetchlinks.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ $.widget( "mobile.fetchlink", $.mobile.widget, {
88
var self = $( this.element ),
99
target = self.attr( "href" ) ? self : self.find( "a" ).not( ":jqmData(target)" );
1010

11-
target
12-
.click(function() {
11+
target.bind("click", function(e) {
1312
var el = $( this ),
1413
url = el.attr( "href" ),
1514
target = self.jqmData( "target" ),
@@ -60,13 +59,18 @@ $.widget( "mobile.fetchlink", $.mobile.widget, {
6059
normalizePath( 'img', 'src' );
6160
normalizePath( 'a', 'href');
6261

63-
setTimeout(function() {
62+
setTimeout(function() {
6463
targetEl[ method ]( responseEl.addClass('fade in') );
6564

65+
targetEl.filter( ':jqmData(role="listview")' ).length && targetEl.listview( "refresh" );
66+
6667
targetEl
67-
.listview( "refresh" ) // This should work with trigger( "refresh" ).
68+
.trigger( "create" )
6869
.removeClass('ui-loading-inline')
6970
.height('auto');
71+
72+
console.log("Plugin fired and completed");
73+
7074
}, 300);
7175
});
7276
}
@@ -79,16 +83,17 @@ $.widget( "mobile.fetchlink", $.mobile.widget, {
7983

8084
$( document ).bind( "inlineLoader", function( e, ui ){
8185
if( ui.method === "html" ) {
82-
$( e.target ).children().removeClass('fade in').addClass('fade out');
86+
//$( e.target ).children().removeClass('fade in').addClass('fade out');
8387

8488
setTimeout(function() {
85-
$( e.target ).html( "<div class='ui-loader-inline fade in'><span class='ui-icon ui-icon-loading spin'></span></div>" );
89+
//$( e.target ).html( "<div class='ui-loader-inline fade in'><span class='ui-icon ui-icon-loading spin'></span></div>" );
8690
}, 300);
8791
}
8892
});
8993

9094
//auto self-init widgets
9195
$( document ).bind( "pagecreate create", function( e ){
96+
console.log("Create called");
9297
$( $.mobile.fetchlink.prototype.options.initSelector, e.target ).fetchlink();
9398
});
9499

0 commit comments

Comments
 (0)