Swipe: VI update and swipe speed has been changed
[platform/framework/web/web-ui-fw.git] / src / widgets / swipe / js / jquery.mobile.tizen.swipe.js
index 776667d..62ce7cd 100644 (file)
                        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')
 
                                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 );
                                        });
                                }
 
                //
                // 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');
                        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 () {
 
                        $( self._covers ).each( function () {
                                var cover = $( this );
-                               self._animateCover( cover, 110 );
+                               self._animateCover( cover, 110, self._item);
                        } );
                },
 
 
                        $( self._covers ).each( function () {
                                var cover = $( this );
-                               self._animateCover( cover, 0 );
+                               self._animateCover( cover, 0, self._item);
                        } );
                }