integrations: Add animation to integrations dropdown.

We make the integration categories dropdown gradually slide down/up
rather than appearing instantenously. I believe this gives a better
look to the dropdown and how it behaves.

We also fiddle a bit with the code relating to angle icon in the
dropdown. Basically though its behaviour was already buggy and
will be addressed in an upcoming commit, we try to maintain whatever
behaviour it had before introduction of the annimation effect.
This commit is contained in:
Aditya Bansal 2018-07-05 23:43:36 +05:30 committed by Tim Abbott
parent 11f896809f
commit b32f54e775
1 changed files with 6 additions and 5 deletions

View File

@ -321,18 +321,19 @@ function dispatch(action, payload) {
function toggle_categories_dropdown() { function toggle_categories_dropdown() {
var $dropdown_list = $('.integration-categories-dropdown .dropdown-list'); var $dropdown_list = $('.integration-categories-dropdown .dropdown-list');
$dropdown_list.toggle();
if ($dropdown_list.css('display') === 'none' && if ($dropdown_list.css('display') === 'none' &&
state.category === INITIAL_STATE.category) { state.category === INITIAL_STATE.category) {
$('.integration-categories-dropdown i')
.removeClass('fa-angle-down')
.addClass('fa-angle-right');
} else {
$('.integration-categories-dropdown i') $('.integration-categories-dropdown i')
.removeClass('fa-angle-right') .removeClass('fa-angle-right')
.addClass('fa-angle-down'); .addClass('fa-angle-down');
} else {
$('.integration-categories-dropdown i')
.removeClass('fa-angle-down')
.addClass('fa-angle-right');
} }
$dropdown_list.slideToggle(250);
} }
function integration_events() { function integration_events() {