Merge pull request #548 from jitendra-webkul/jitendra

Fixed account menu issue
This commit is contained in:
JItendra Singh 2019-02-04 20:32:42 +05:30 committed by GitHub
commit 373e95c8de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 18 deletions

View File

@ -27,24 +27,16 @@
@push('scripts')
<script>
$(document).ready(function() {
var downIcon = document.getElementById("down-icon");
var accountSideMenu = document.getElementsByClassName("menubar");
downIcon.addEventListener("click", function() {
if (downIcon.className == 'icon icon-arrow-down right') {
for(let i=0 ; i < accountSideMenu.length ; i++) {
accountSideMenu[i].style.display="block";
}
downIcon.classList.remove("icon","icon-arrow-down","right");
downIcon.classList.add("icon","icon-arrow-up","right");
}else {
for(let i=0 ; i < accountSideMenu.length ; i++) {
accountSideMenu[i].style.display="none";
}
downIcon.classList.remove("icon","icon-arrow-up","right");
downIcon.classList.add("icon","icon-arrow-down","right");
$(".icon.icon-arrow-down.right").on('click', function(e){
var currentElement = $(e.currentTarget);
if (currentElement.hasClass('icon-arrow-down')) {
$(this).parents('.menu-block').find('.menubar').show();
currentElement.removeClass('icon-arrow-down');
currentElement.addClass('icon-arrow-up');
} else {
$(this).parents('.menu-block').find('.menubar').hide();
currentElement.removeClass('icon-arrow-up');
currentElement.addClass('icon-arrow-down');
}
});
});