From 39f8463f807ef6f0020f067665e530ae0a98210d Mon Sep 17 00:00:00 2001 From: "hjnim.kim" Date: Fri, 21 Dec 2012 16:03:33 +0900 Subject: [PATCH] Swipe: VI update and swipe speed has been changed VI has been added( Swipe-item opacity is changed, open(from 0 to 1), close(from 1 to 0) ) Swipe animation speed has been changed( "fast" -> "normal" ) Change-Id: I5bdf0772e88dfb7ec0a5a6b0d0338d1fb373aa9f Signed-off: Hyunjung Kim --- .../tizen/common/jquery.mobile.tizen.swipe.less | 2 +- src/widgets/swipe/js/jquery.mobile.tizen.swipe.js | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/themes/tizen/common/jquery.mobile.tizen.swipe.less b/src/themes/tizen/common/jquery.mobile.tizen.swipe.less index 39f5c68..2172be8 100755 --- a/src/themes/tizen/common/jquery.mobile.tizen.swipe.less +++ b/src/themes/tizen/common/jquery.mobile.tizen.swipe.less @@ -13,7 +13,7 @@ -moz-user-select: none; -webkit-user-select: none; -user-select: none; - + opacity: 0; text-align : center; .ui-btn { diff --git a/src/widgets/swipe/js/jquery.mobile.tizen.swipe.js b/src/widgets/swipe/js/jquery.mobile.tizen.swipe.js index 776667d..62ce7cd 100644 --- a/src/widgets/swipe/js/jquery.mobile.tizen.swipe.js +++ b/src/widgets/swipe/js/jquery.mobile.tizen.swipe.js @@ -159,6 +159,7 @@ item = this.element.find(':jqmData(role="swipe-item")'); this._covers = covers; + this._item = item; item.addClass('ui-swipe-item'); coverTheme = defaultCoverTheme; itemHasThemeClass = item.parent().attr('class') @@ -180,11 +181,11 @@ if ( !( cover.data('animateRight') && cover.data('animateLeft') ) ) { cover.data('animateRight', function () { - self._animateCover( cover, 110 ); + self._animateCover( cover, 110, item ); }); cover.data('animateLeft', function () { - self._animateCover( cover, 0 ); + self._animateCover( cover, 0, item ); }); } @@ -257,11 +258,11 @@ // // once the cover animation is done, the cover emits an // animationComplete event - _animateCover: function ( cover, leftPercentage ) { + _animateCover: function ( cover, leftPercentage, item ) { var self = this, animationOptions = { easing: 'linear', - duration: 'fast', + duration: 'normal', queue: true, complete: function () { cover.trigger('animationComplete'); @@ -288,7 +289,13 @@ cover.stop(); cover.clearQueue(); cover.trigger('animationStart'); - cover.animate( {left: leftPercentage + '%'}, animationOptions ); + cover.animate( { left: leftPercentage + '%' }, animationOptions ); + if ( leftPercentage == 0 ) { + item.animate({ opacity: 0 }, "slow"); + } else { + item.animate({ opacity: 1 }, "slow"); + } + }, destroy: function () { @@ -300,7 +307,7 @@ $( self._covers ).each( function () { var cover = $( this ); - self._animateCover( cover, 110 ); + self._animateCover( cover, 110, self._item); } ); }, @@ -313,7 +320,7 @@ $( self._covers ).each( function () { var cover = $( this ); - self._animateCover( cover, 0 ); + self._animateCover( cover, 0, self._item); } ); } -- 2.7.4