1 From 9194807cb435b256bf5f4d45f585e1ed0bbab303 Mon Sep 17 00:00:00 2001
2 From: jinhyuk <jinhyuk@jinhyuk-DeskTop.(none)>
3 Date: Wed, 12 Dec 2012 18:34:46 +0900
4 Subject: [PATCH] JQM add TIZEN back btn
6 Change-Id: If1c5e68cff21d78abcc499b9eac7a6a3222f09be
8 libs/js/jquery-mobile-1.2.0/js/widgets/page.js | 13 +++++
9 .../js/widgets/page.sections.js | 19 ++++++--
10 ...d-back-btn-option-and-remove-jqm-back-btn.patch | 51 --------------------
11 3 files changed, 27 insertions(+), 56 deletions(-)
12 delete mode 100644 libs/patch/0014-JQM-add-back-btn-option-and-remove-jqm-back-btn.patch
14 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
15 index 256fbb2..d80bd26 100644
16 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.js
17 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.js
18 @@ -46,6 +46,19 @@ $.widget( "mobile.page", $.mobile.widget, {
22 + addBackBtn : function ( target ) {
23 + var $dest = $( ".ui-page-active .ui-footer" );
25 + if ( target == "header" ) {
26 + $dest = $( ".ui-page-active .ui-header" );
28 + backBtn = $( "<a href='#' class='ui-btn-back' data-" + $.mobile.ns + "rel='back'></a>" )
29 + .buttonMarkup( {icon: "header-back-btn", theme : "s"} );
30 + if ( !$dest.find( ".ui-btn-back").length ) {
31 + backBtn.prependTo( $dest );
35 keepNativeSelector: function() {
36 var options = this.options,
37 keepNativeDefined = options.keepNative && $.trim( options.keepNative );
38 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
39 index 7c05ecb..90a298a 100644
40 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
41 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
42 @@ -35,6 +35,7 @@ $( document ).bind( "pagecreate", function( e ) {
46 + $dest = $page.find( ".ui-footer" ),
49 $this.addClass( "ui-" + role );
50 @@ -63,15 +64,23 @@ $( document ).bind( "pagecreate", function( e ) {
52 // Auto-add back btn on pages beyond first view
54 - role === "header" &&
55 - $( ".ui-page" ).length > 1 &&
56 + ( role === "footer" || role === "header" ) &&
57 $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
60 - backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
61 + if ( o.addBackBtn == "header" ) {
62 + $dest = $page.find( ".ui-header" );
64 + $dest = $page.find( ".ui-footer" );
67 + backBtn = $( "<a href='javascript:void(0);' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )
68 // If theme is provided, override default inheritance
69 - .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
70 - .prependTo( $this );
71 + .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme );
73 + if ( !$dest.find( ".ui-btn-back" ).length ) {
74 + backBtn.prependTo( $dest );
79 diff --git a/libs/patch/0014-JQM-add-back-btn-option-and-remove-jqm-back-btn.patch b/libs/patch/0014-JQM-add-back-btn-option-and-remove-jqm-back-btn.patch
80 deleted file mode 100644
81 index 1ca3002..0000000
82 --- a/libs/patch/0014-JQM-add-back-btn-option-and-remove-jqm-back-btn.patch
85 -From 252820a3ea292bf652d2ecd644c0126152a20f46 Mon Sep 17 00:00:00 2001
86 -From: Jun Jinhyuk <jinhyuk.jun@samsung.com>
87 -Date: Wed, 28 Nov 2012 14:25:58 +0900
88 -Subject: [PATCH] JQM add back btn option and remove jqm back btn
90 -Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
92 - .../js/widgets/page.sections.js | 16 ++--------------
93 - 1 files changed, 2 insertions(+), 14 deletions(-)
95 -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
96 -index 7c05ecb..cbf6786 100644
97 ---- a/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
98 -+++ b/libs/js/jquery-mobile-1.2.0/js/widgets/page.sections.js
99 -@@ -8,11 +8,12 @@ define( [ "jquery", "./page", "../jquery.mobile.core" ], function( $ ) {
100 - (function( $, undefined ) {
102 - $.mobile.page.prototype.options.backBtnText = "Back";
103 --$.mobile.page.prototype.options.addBackBtn = false;
104 -+$.mobile.page.prototype.options.addBackBtn = "footer";
105 - $.mobile.page.prototype.options.backBtnTheme = null;
106 - $.mobile.page.prototype.options.headerTheme = "a";
107 - $.mobile.page.prototype.options.footerTheme = "a";
108 - $.mobile.page.prototype.options.contentTheme = null;
109 -+$.mobile.page.prototype.options.footerExist = true;
111 - // NOTE bind used to force this binding to run before the buttonMarkup binding
112 - // which expects .ui-footer top be applied in its gigantic selector
113 -@@ -61,19 +62,6 @@ $( document ).bind( "pagecreate", function( e ) {
114 - rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
117 -- // Auto-add back btn on pages beyond first view
118 -- if ( o.addBackBtn &&
119 -- role === "header" &&
120 -- $( ".ui-page" ).length > 1 &&
121 -- $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
124 -- backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
125 -- // If theme is provided, override default inheritance
126 -- .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
127 -- .prependTo( $this );
131 - $this.children( "h1, h2, h3, h4, h5, h6" )
132 - .addClass( "ui-title" )