1 From 01ba67004fdeaa1c205935ffb3e6739a9005cc21 Mon Sep 17 00:00:00 2001
2 From: Minkyu Kang <mk7.kang@samsung.com>
3 Date: Wed, 29 Feb 2012 11:28:03 +0900
4 Subject: [PATCH] JQM: Change button design to meet TIZEN UI
6 Signed-off-by: Lee Wongi <wongi11.lee@samsung.com>
7 Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
9 .../js/jquery.mobile.buttonMarkup.js | 61 +++++++++++++++++++-
10 1 files changed, 58 insertions(+), 3 deletions(-)
12 diff --git a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
13 index d192e37..93485f1 100644
14 --- a/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
15 +++ b/libs/js/jquery-mobile-1.0.1pre/js/jquery.mobile.buttonMarkup.js
17 * "buttons" plugin - for making button-like links
21 + * Button Markup modified for TIZEN style.
26 + * data-style: circle, nobg, edit
30 + * <div data-role="button" data-inline="true" data-icon="send" data-style="circle"></div>
31 + * <div data-role="button" data-inline="true" data-icon="favorite" data-style="nobg">
32 + * <div data-role="button" data-inline="true" data-icon="editminus" data-style="edit"></div>
35 ( function( $, undefined ) {
37 $.fn.buttonMarkup = function( options ) {
38 @@ -73,8 +88,48 @@ $.fn.buttonMarkup = function( options ) {
39 buttonClass += " ui-shadow";
42 - e.setAttribute( "data-" + $.mobile.ns + "theme", o.theme );
43 - el.addClass( buttonClass );
44 + /* TIZEN style markup */
45 + buttonStyle = el.jqmData("style");
47 + if ( buttonStyle == "circle" ) {
48 + /* style : no text, Icon only */
49 + buttonClass += " ui-btn-corner-circle";
50 + buttonClass += " ui-btn-icon_only";
51 + } else if ( buttonStyle == "nobg" ) {
52 + /* style : no text, Icon only, no bg */
53 + buttonClass += " ui-btn-icon-nobg";
54 + buttonClass += " ui-btn-icon_only";
55 + } else if ( buttonStyle == "edit" ) {
56 + buttonClass += " ui-btn-edit";
60 + if ( $(el).text().length > 0 ) {
61 + o.iconpos == "right" ?
62 + textClass += " ui-btn-text-padding-right" :
63 + textClass += " ui-btn-text-padding-left";
65 + innerClass += " ui-btn-hastxt";
67 + if ( buttonStyle == "circle" ) {
68 + /* style : no text, Icon only */
69 + innerClass += " ui-btn-corner-circle";
70 + } else if ( buttonStyle == "nobg" ) {
71 + /* style : no text, Icon only, no bg */
72 + innerClass += " ui-btn-icon-nobg";
75 + buttonClass += " ui-btn-icon_only";
76 + innerClass += " ui-btn-icon-only";
79 + if ( $(el).text().length > 0 ) {
80 + innerClass += " ui-btn-hastxt";
84 + el.attr( "data-" + $.mobile.ns + "theme", o.theme )
85 + .addClass( buttonClass );
87 buttonInner.className = innerClass;
88 buttonInner.setAttribute("aria-hidden", "true");
89 @@ -96,7 +151,7 @@ $.fn.buttonMarkup = function( options ) {
90 // TODO obviously it would be nice to pull this element out instead of
91 // retrieving it from the DOM again, but this change is much less obtrusive
93 - $.data( e, 'textWrapper', $( buttonText ) );
94 + el.data( 'textWrapper', $( buttonText ) );