Export 0.2.3
[platform/framework/web/web-ui-fw.git] / libs / patch / 0014-JQM-add-TIZEN-back-btn.patch
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
5
6 Change-Id: If1c5e68cff21d78abcc499b9eac7a6a3222f09be
7 ---
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
13
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, {
19                 }
20         },
21  
22 +       addBackBtn : function ( target ) {
23 +               var $dest = $( ".ui-page-active .ui-footer" );
24 +
25 +               if ( target == "header" ) {
26 +                       $dest = $( ".ui-page-active .ui-header" );
27 +               }
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 );
32 +               }
33 +       },
34 +
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 ) {
43                         $headeranchors,
44                         leftbtn,
45                         rightbtn,
46 +                       $dest = $page.find( ".ui-footer" ),
47                         backBtn;
48  
49                 $this.addClass( "ui-" + role );
50 @@ -63,15 +64,23 @@ $( document ).bind( "pagecreate", function( e ) {
51  
52                         // Auto-add back btn on pages beyond first view
53                         if ( o.addBackBtn &&
54 -                               role === "header" &&
55 -                               $( ".ui-page" ).length > 1 &&
56 +                               ( role === "footer" || role === "header" ) &&
57                                 $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
58                                 !leftbtn ) {
59  
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" );
63 +                               } else {
64 +                                       $dest = $page.find( ".ui-footer" );
65 +                               }
66 +
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 );
72 +
73 +                               if ( !$dest.find( ".ui-btn-back" ).length ) {
74 +                                       backBtn.prependTo( $dest );
75 +                               }
76                         }
77  
78                         // Page title
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
83 +++ /dev/null
84 @@ -1,51 +0,0 @@
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
89 -
90 -Signed-off-by: Jun Jinhyuk <jinhyuk.jun@samsung.com>
91 ----
92 - .../js/widgets/page.sections.js                    |   16 ++--------------
93 - 1 files changed, 2 insertions(+), 14 deletions(-)
94 -
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 ) {
101
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;
110
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;
115 -                       }
116
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 ) &&
122 --                              !leftbtn ) {
123 --
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 );
128 --                      }
129 --
130 -                       // Page title
131 -                       $this.children( "h1, h2, h3, h4, h5, h6" )
132 -                               .addClass( "ui-title" )
133 --- 
134 -1.7.4.1
135 -
136 -- 
137 1.7.9.5
138