Commit 6690fc70 authored by Fatih Acet's avatar Fatih Acet

Merge branch 'replace-animate-emoji-timeout' into 'master'

Replace animateEmoji timeout with eventListener

## What does this MR do?
Replaces the end animation timeout for awards_handler.js with an eventListener that listens for the animationEnd event

## Are there points in the code the reviewer needs to double check?
Check for any side effects

## Why was this MR needed?
Improve code quality so that it is easier to understand

## What are the relevant issue numbers?
Closes #20679 

## Does this MR meet the acceptance criteria?

- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !5690
parents 4ce348c7 0986fe23
......@@ -29,6 +29,7 @@ v 8.12.0 (unreleased)
- API: Expose issue confidentiality flag. (Robert Schilling)
- Fix markdown anchor icon interaction (ClemMakesApps)
- Test migration paths from 8.5 until current release !4874
- Replace animateEmoji timeout with eventListener (ClemMakesApps)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
......
......@@ -255,12 +255,12 @@
};
AwardsHandler.prototype.animateEmoji = function($emoji) {
var className;
className = 'pulse animated';
var className = 'pulse animated once short';
$emoji.addClass(className);
return setTimeout((function() {
return $emoji.removeClass(className);
}), 321);
$emoji.on('webkitAnimationEnd animationEnd', function() {
$(this).removeClass(className);
});
};
AwardsHandler.prototype.createEmoji = function(votesBlock, emoji) {
......
......@@ -8,65 +8,44 @@
// Copyright (c) 2016 Daniel Eden
.animated {
-webkit-animation-duration: 1s;
animation-duration: 1s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.infinite {
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
@include webkit-prefix(animation-duration, 1s);
@include webkit-prefix(animation-fill-mode, both);
.animated.hinge {
-webkit-animation-duration: 2s;
animation-duration: 2s;
}
&.infinite {
@include webkit-prefix(animation-iteration-count, infinite);
}
.animated.flipOutX,
.animated.flipOutY,
.animated.bounceIn,
.animated.bounceOut {
-webkit-animation-duration: .75s;
animation-duration: .75s;
}
&.once {
@include webkit-prefix(animation-iteration-count, 1);
}
@-webkit-keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
&.hinge {
@include webkit-prefix(animation-duration, 2s);
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
&.flipOutX,
&.flipOutY,
&.bounceIn,
&.bounceOut {
@include webkit-prefix(animation-duration, .75s);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
&.short {
@include webkit-prefix(animation-duration, 321ms);
@include webkit-prefix(animation-fill-mode, none);
}
}
@keyframes pulse {
from {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
@include keyframes(pulse) {
from, to {
@include webkit-prefix(transform, scale3d(1, 1, 1));
}
50% {
-webkit-transform: scale3d(1.05, 1.05, 1.05);
transform: scale3d(1.05, 1.05, 1.05);
}
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
@include webkit-prefix(transform, scale3d(1.05, 1.05, 1.05));
}
}
.pulse {
-webkit-animation-name: pulse;
animation-name: pulse;
@include webkit-prefix(animation-name, pulse);
}
......@@ -85,3 +85,13 @@
#{'-webkit-' + $property}: $value;
#{$property}: $value;
}
@mixin keyframes($animation-name) {
@-webkit-keyframes #{$animation-name} {
@content;
}
@keyframes #{$animation-name} {
@content;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment