1 From 9194807cb435b256bf5f4d45f585e1ed0bbab303 Mon Sep 17 00:00:00 2001
2 From: Jinhyuk Jun <jinhyuk.jun@samsung.com>
3 Date: Wed, 12 Dec 2012 18:34:46 +0900
4 Subject: [PATCH] JQM: add TIZEN back btn
6 Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
8 libs/js/jquery-mobile-1.2.0/js/widgets/page.js | 13 +++++
9 .../js/widgets/page.sections.js | 19 ++++++--
10 2 files changed, 27 insertions(+), 56 deletions(-)
11 delete mode 100644 libs/patch/0014-JQM-add-back-btn-option-and-remove-jqm-back-btn.patch
13 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/page.js b/libs/js/jquery-mobile-1.2.0/js/widgets/page.js
14 index 256fbb2..d80bd26 100644
15 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.js
16 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.js
17 @@ -46,6 +46,19 @@ $.widget( "mobile.page", $.mobile.widget, {
21 + addBackBtn : function ( target ) {
22 + var $dest = $( ".ui-page-active .ui-footer" );
24 + if ( target == "header" ) {
25 + $dest = $( ".ui-page-active .ui-header" );
27 + backBtn = $( "<a href='#' class='ui-btn-back' data-" + $.mobile.ns + "rel='back'></a>" )
28 + .buttonMarkup( {icon: "header-back-btn", theme : "s"} );
29 + if ( !$dest.find( ".ui-btn-back").length ) {
30 + backBtn.prependTo( $dest );
34 keepNativeSelector: function() {
35 var options = this.options,
36 keepNativeDefined = options.keepNative && $.trim( options.keepNative );
37 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
38 index 7c05ecb..90a298a 100644
39 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
40 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
41 @@ -35,6 +35,7 @@ $( document ).bind( "pagecreate", function( e ) {
45 + $dest = $page.find( ".ui-footer" ),
48 $this.addClass( "ui-" + role );
49 @@ -63,15 +64,23 @@ $( document ).bind( "pagecreate", function( e ) {
51 // Auto-add back btn on pages beyond first view
53 - role === "header" &&
54 - $( ".ui-page" ).length > 1 &&
55 + ( role === "footer" || role === "header" ) &&
56 $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
59 - backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
60 + if ( o.addBackBtn == "header" ) {
61 + $dest = $page.find( ".ui-header" );
63 + $dest = $page.find( ".ui-footer" );
66 + backBtn = $( "<a href='javascript:void(0);' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )
67 // If theme is provided, override default inheritance
68 - .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
69 - .prependTo( $this );
70 + .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme );
72 + if ( !$dest.find( ".ui-btn-back" ).length ) {
73 + backBtn.prependTo( $dest );