1 From 189014d78087fa36d63f399a0fb756b61252a4dc Mon Sep 17 00:00:00 2001
2 From: "hjnim.kim" <hjnim.kim@samsung.com>
3 Date: Mon, 26 Nov 2012 20:22:14 +0900
4 Subject: [PATCH] JQM: Applied Tizen Button Style
6 Signed-off-by: hjnim.kim <hjnim.kim@samsung.com>
8 .../js/jquery.mobile.buttonMarkup.js | 56 ++++++++++++++++++++
9 1 files changed, 56 insertions(+), 0 deletions(-)
11 diff --git a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
12 index 3d7d884..0be6999 100644
13 --- a/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
14 +++ b/libs/js/jquery-mobile-1.2.0/js/jquery.mobile.buttonMarkup.js
15 @@ -80,6 +80,62 @@ $.fn.buttonMarkup = function( options ) {
16 buttonClass += o.shadow ? " ui-shadow" : "";
17 buttonClass += o.corners ? " ui-btn-corner-all" : "";
19 + // To distinguish real buttons
20 + if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
21 + buttonClass += " ui-btn-box-" + o.theme;
24 + /* TIZEN style markup */
25 + buttonStyle = el.jqmData("style");
27 + if ( buttonStyle == "circle" && !($(el).text().length > 0) ) {
28 + /* style : no text, Icon only */
29 + buttonClass += " ui-btn-corner-circle";
30 + buttonClass += " ui-btn-icon_only";
31 + } else if ( buttonStyle == "nobg" ) {
32 + /* style : no text, Icon only, no bg */
33 + buttonClass += " ui-btn-icon-nobg";
34 + buttonClass += " ui-btn-icon_only";
35 + } else if ( buttonStyle == "edit" ) {
36 + buttonClass += " ui-btn-edit";
37 + } else if ( buttonStyle == "round" || ( buttonStyle == "circle" && $(el).text().length > 0 ) ) {
38 + buttonClass += " ui-btn-round";
41 + if ( $(el).text().length > 0 ) {
43 + switch ( o.iconpos ) {
48 + textClass += " ui-btn-text-padding-" + o.iconpos;
51 + textClass += " ui-btn-text-padding-left";
55 + innerClass += " ui-btn-hastxt";
57 + if ( buttonStyle == "circle" ) {
58 + /* style : no text, Icon only */
59 + innerClass += " ui-btn-corner-circle";
60 + } else if ( buttonStyle == "nobg" ) {
61 + /* style : no text, Icon only, no bg */
62 + innerClass += " ui-btn-icon-nobg";
65 + buttonClass += " ui-btn-icon_only";
66 + innerClass += " ui-btn-icon-only";
69 + if ( $(el).text().length > 0 ) {
70 + innerClass += " ui-btn-hastxt";
71 + } else if ( buttonStyle == "circle" ){
72 + buttonClass += " ui-btn-round";
75 if ( o.mini !== undefined ) {
76 // Used to control styling in headers/footers, where buttons default to `mini` style.
77 buttonClass += o.mini === true ? " ui-mini" : " ui-fullsize";