Collapsible: remove activeBtnClass from collapsible heading
authorPrzemyslaw Ciezkowski <p.ciezkowski@samsung.com>
Mon, 24 Jun 2013 12:05:38 +0000 (14:05 +0200)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Mon, 29 Jul 2013 01:45:12 +0000 (01:45 +0000)
Click and vmousecancel are not always triggered after vclick
(vmouse events don't work the same way as native browser blick event).
This patch adds activeBtnClass on vmousedown event and removes
it on vmouseup or vmousecancel. This way this class will be
always removed.
Fixes #N_SE-36385

Change-Id: I2031698eff61643850867179bf3174d2c65f78fb

libs/patch/0048-Collapsible-remove-ui-btn-active-class-when-expand-c.patch

index 035520a..a5e367c 100644 (file)
@@ -1,4 +1,4 @@
-From 33ba869404135065a233af08bc1eaca05f435268 Mon Sep 17 00:00:00 2001
+From 7d2642d5f8a5a714163c7614581c28950e58fe44 Mon Sep 17 00:00:00 2001
 From: Przemyslaw Ciezkowski <p.ciezkowski@samsung.com>
 Date: Wed, 12 Jun 2013 11:15:52 +0200
 Subject: [PATCH] Collapsible: remove ui-btn-active class when expand/collapse
@@ -6,22 +6,32 @@ Subject: [PATCH] Collapsible: remove ui-btn-active class when expand/collapse
 
 Change-Id: Icb8772fa56461ef43e735b72545f0e27a335ff34
 ---
- .../jquery-mobile-1.2.0/js/widgets/collapsible.js  |    5 ++++-
- 1 files changed, 4 insertions(+), 1 deletions(-)
+ .../jquery-mobile-1.2.0/js/widgets/collapsible.js  |    8 +++++---
+ 1 files changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
-index 8398de4..eee244e 100644
+index 8398de4..cb0225b 100644
 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/collapsible.js
-@@ -153,9 +153,12 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+@@ -134,8 +134,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
+                                                       .toggleClass( "ui-icon-" + expandedIcon, !isCollapse )
+                                                       // logic or cause same icon for expanded/collapsed state would remove the ui-icon-class
+                                                       .toggleClass( "ui-icon-" + collapsedIcon, ( isCollapse || expandedIcon === collapsedIcon ) )
+-                                              .end()
+-                                              .find( "a" ).first().removeClass( $.mobile.activeBtnClass );
++                                              .end();
+                                       $this.toggleClass( "ui-collapsible-collapsed", isCollapse );
+                                       collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
+@@ -153,9 +152,12 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
                        .trigger( o.collapsed ? "collapse" : "expand" );
  
                collapsibleHeading
 -                      .bind( "tap", function( event ) {
-+                      .bind( "tap", function() {
++                      .bind( "vmousedown", function() {
                                collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
                        })
-+                      .bind( "vmousecancel", function() {
++                      .bind( "vmousecancel vmouseup", function() {
 +                              collapsibleHeading.find( "a" ).first().removeClass( $.mobile.activeBtnClass );
 +                      })
                        .bind( "click", function( event ) {