Skip to content

Commit

Permalink
Improved action javscript logic, andd rotation effect
Browse files Browse the repository at this point in the history
  • Loading branch information
vovayatsyuk committed Feb 8, 2017
1 parent 8dfcc87 commit 798ad42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion js/tm/adminhtml/core/actions.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
border-top-color: #ea7601;
border-bottom: none;
}
.active .tm-action-select::after {
transform: rotate(180deg);
}
.tm-action-menu {
display: none;
z-index: 10;
position: absolute;
top: 18px;
Expand All @@ -35,10 +39,12 @@
border: 1px solid #aaa;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.active .tm-action-menu {
display: block;
}
.tm-action-menu li {
margin: 5px 0;
}
.tm-action-menu a {
display: block;
text-decoration: none;
}
8 changes: 4 additions & 4 deletions js/tm/adminhtml/core/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ TmcoreActions.prototype = {
document.on('click', '.tm-action-select', function(e, el) {
e.stop();

var menu = el.next(),
isVisible = menu.visible();
var wrapper = el.up(),
isVisible = wrapper.hasClassName('active');

$$('.tm-action-menu').invoke('hide');
$$('.tm-action-select-wrap').invoke('removeClassName', 'active');

if (!isVisible) {
el.next().show();
wrapper.addClassName('active');
}
});
}
Expand Down

0 comments on commit 798ad42

Please sign in to comment.