jenkins-bot has submitted this change and it was merged.

Change subject: Animation on 'Favorite' and 'Discard' actions
......................................................................


Animation on 'Favorite' and 'Discard' actions

TODO: There is a tooltip appearing 'Lion is added for later' in design
That is not done.

Bug: T125379
Change-Id: I294b33d322bffa9804c858249683fc9b60425b33
---
M modules/dashboard/ext.cx.suggestionlist.js
M modules/dashboard/styles/ext.cx.lists.common.less
M modules/dashboard/styles/ext.cx.suggestionlist.less
3 files changed, 27 insertions(+), 10 deletions(-)

Approvals:
  Nikerabbit: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/dashboard/ext.cx.suggestionlist.js 
b/modules/dashboard/ext.cx.suggestionlist.js
index f75ecb9..55ebdcc 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -582,9 +582,12 @@
                api.postWithToken( 'edit', params ).done( function ( response ) 
{
                        var favoriteListId;
                        if ( response.cxsuggestionlist.result === 'success' ) {
-                               suggestion.$element.slideUp( 'slow', function 
() {
-                                       $( this ).remove();
-                               } );
+                               suggestion.$element.addClass( 'cx-slideup-hide' 
);
+                               suggestion.$element.one( 'transitionend 
webkitTransitionEnd oTransitionEnd MSTransitionEnd',
+                                       function () {
+                                               $( this ).remove();
+                                       }
+                               );
 
                                favoriteListId = self.getListId( 
'cx-suggestionlist-favorite' );
                                suggestion.listId = favoriteListId;
@@ -628,14 +631,17 @@
                };
                api.postWithToken( 'edit', params ).done( function ( response ) 
{
                        if ( response.cxsuggestionlist.result === 'success' ) {
-                               suggestion.$element.slideUp( 'slow', function 
() {
-                                       var favoriteListId;
-                                       $( this ).remove();
-                                       favoriteListId = self.getListId( 
'cx-suggestionlist-favorite' );
-                                       if ( !self.lists[ favoriteListId 
].$list.find( '.cx-slitem' ).length ) {
-                                               self.lists[ favoriteListId 
].$list.hide();
+                               suggestion.$element.addClass( 
'cx-slidedown-hide' );
+                               suggestion.$element.one( 'transitionend 
webkitTransitionEnd oTransitionEnd MSTransitionEnd',
+                                       function () {
+                                               var favoriteListId;
+                                               $( this ).remove();
+                                               favoriteListId = 
self.getListId( 'cx-suggestionlist-favorite' );
+                                               if ( !self.lists[ 
favoriteListId ].$list.find( '.cx-slitem' ).length ) {
+                                                       self.lists[ 
favoriteListId ].$list.hide();
+                                               }
                                        }
-                               } );
+                               );
                                // Do we need to add to general suggestions?
                        }
                        // TODO: What happens if this fails?
diff --git a/modules/dashboard/styles/ext.cx.lists.common.less 
b/modules/dashboard/styles/ext.cx.lists.common.less
index c41d4e7..70c7d91 100644
--- a/modules/dashboard/styles/ext.cx.lists.common.less
+++ b/modules/dashboard/styles/ext.cx.lists.common.less
@@ -21,6 +21,7 @@
        &:last-child {
                border: 1px solid #ddd;
        }
+       transition: 1s ease;
 }
 
 .cx-translationlist-empty,
diff --git a/modules/dashboard/styles/ext.cx.suggestionlist.less 
b/modules/dashboard/styles/ext.cx.suggestionlist.less
index 922f647..64a1e28 100644
--- a/modules/dashboard/styles/ext.cx.suggestionlist.less
+++ b/modules/dashboard/styles/ext.cx.suggestionlist.less
@@ -155,3 +155,13 @@
        border-radius: 1px;
        font-size: small;
 }
+
+.cx-slideup-hide {
+       transform: translateY(-200%);
+       opacity: 0;
+}
+
+.cx-slidedown-hide {
+       transform: translateY(200%);
+       opacity: 0;
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/269665
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I294b33d322bffa9804c858249683fc9b60425b33
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to