Skip to content

Commit 3b17dee

Browse files
committed
update sidebar menu
1 parent d8f0700 commit 3b17dee

File tree

4 files changed

+71
-27
lines changed

4 files changed

+71
-27
lines changed

resources/css/ocify-sidebar.css

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828
#sidebar-wrapper::-webkit-scrollbar-button {
29-
display:none;
29+
display: none;
3030
}
3131

3232
#wrapper.toggled {
@@ -96,12 +96,12 @@
9696
font-weight: 400;
9797
font-family: 'Poppins';
9898
font-size: 16px;
99-
padding-right:20px;
99+
padding-right: 20px;
100100
justify-content: space-between;
101101
}
102102

103103
.sidebar-nav .sidebar-addon.active .sidebar-addon-link {
104-
color: #fff!important;
104+
color: #fff !important;
105105
font-weight: 600;
106106
}
107107

@@ -110,12 +110,12 @@
110110
}
111111

112112
.sidebar-nav .sidebar-sublist ul {
113-
padding:0;
113+
padding: 0;
114114
}
115115

116116
#wrapper.toggled-2 .title,
117117
#wrapper.toggled-2 .navbar-form,
118-
#wrapper.toggled-2 .group-sublist{
118+
#wrapper.toggled-2 .group-sublist {
119119
display: none;
120120
}
121121

@@ -139,7 +139,7 @@
139139
transition: all 700ms ease;
140140
}
141141

142-
.sidebar-nav .sidebar-sublist .sub-item.active a{
142+
.sidebar-nav .sidebar-sublist .sub-item.active a {
143143
color: #BFD3E9 !important;
144144
}
145145

@@ -168,12 +168,12 @@
168168
align-items: center;
169169
}
170170

171-
.sidebar-nav .sidebar-group .sidebar-group-link span:not(.icon){
171+
.sidebar-nav .sidebar-group .sidebar-group-link span:not(.icon) {
172172
align-items: center;
173173
display: flex;
174174
}
175175

176-
.sidebar-nav .sidebar-group .sidebar-group-link span .icon{
176+
.sidebar-nav .sidebar-group .sidebar-group-link span .icon {
177177
padding-top: 3px;
178178
}
179179

@@ -280,7 +280,7 @@
280280
}
281281

282282
#wrapper.toggled-2 #sidebar-wrapper,
283-
#wrapper.toggled-2 .logo-bar{
283+
#wrapper.toggled-2 .logo-bar {
284284
width: 70px;
285285
}
286286

@@ -300,7 +300,6 @@
300300
}
301301

302302

303-
304303
#page-content-wrapper {
305304
padding: 20px;
306305
position: relative;
@@ -416,7 +415,13 @@ li.active {
416415

417416
#sidebar-wrapper .navbar-form input {
418417
width: 230px;
419-
background-color: rgba(255,255,255,0.2) !important;
418+
background-color: rgba(255, 255, 255, 0.2) !important;
419+
}
420+
421+
#sidebar-wrapper .navbar-form input:active,
422+
#sidebar-wrapper .navbar-form input:focus {
423+
background-color: rgba(255, 255, 255, 0.6) !important;
424+
color: #000 !important;
420425
}
421426

422427
#sidebar-wrapper .navbar-form button {
@@ -427,3 +432,13 @@ li.active {
427432
.logo-bar-table {
428433
background-color: #30426a !important;
429434
}
435+
436+
#ocify-menu .tooltip {
437+
position: fixed;
438+
}
439+
440+
#ocify-menu .tooltip .tooltip-inner {
441+
background: rgba(255,255,255,0.9);
442+
color: #000 !important;
443+
margin-left: 1rem;
444+
}

resources/css/theme.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ color: #ddd;
449449
}
450450
#search .results {
451451
min-width: 15rem;
452+
margin-left: 1rem;
452453
}
453454

454455
#Path_21097, #Line_828, #Path_21098 {

resources/js/ocify-sidebar.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,26 @@ $("#menu-toggle").click(function(e) {
2424
// }
2525
// );
2626
// }
27-
// $(document).ready(function() {initMenu();});
27+
// $(document).ready(function() {initMenu();});
28+
29+
30+
function flexExpended(class_name)
31+
{
32+
$(class_name).on('click', function () {
33+
if ($(this).attr('aria-expanded') === "false")
34+
{
35+
let opened_element = $(class_name+'[aria-expanded="true"]');
36+
37+
opened_element.attr('aria-expanded', false);
38+
opened_element.addClass('collapsed');
39+
40+
let target = opened_element.data('target');
41+
42+
$(target).removeClass('in');
43+
$(target).attr('aria-expanded', false);
44+
}
45+
});
46+
}
47+
48+
flexExpended('.sidebar-addon-link');
49+
flexExpended('.sidebar-group-link');

resources/views/partials/interactiveMenu.twig

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="logo-bar">
44
<div class="button-menu logo-bar-table">
55
<div class="align-middle text-center logo-bar-cell menu-action">
6-
<div class="navbar-collapse" id="bs-example-navbar-collapse-1">
6+
<div class="navbar-collapse" id="bs-example-navbar-collapse-1" style="padding-left: 0 !important;">
77
<ul class="nav navbar-nav">
88
<li class="active">
99
<button id="menu-toggle-2" type="button" class="button-menu-mobile web-sidebar-btn">
@@ -36,7 +36,7 @@
3636
<a class="sidebar-group-link" title="{{ group.title }}" data-toggle="collapse"
3737
data-target="#{{ group_key }}M"
3838
aria-expanded="{{ group.active ? 'true' : 'false' }}">
39-
<span>
39+
<span data-toggle="tooltip" data-placement="right" title="{{ group.title }}">
4040
<span class="icon">
4141
{% if group.icon %}
4242
{{ img(group.icon).data|raw }}
@@ -46,12 +46,15 @@
4646
</span>
4747
<i class="fa fa-chevron-down chevron"></i>
4848
</a>
49-
<div class="collapse {{ group.active ? 'in' }} group-sublist" id="{{ group_key }}M"
50-
aria-expanded="false">
49+
<div class="collapse {{ group.active ? 'in' }} group-sublist" id="{{ group_key }}M" data-parent="#ocify-menu"
50+
aria-expanded="{{ group.active ? 'true' : 'false' }}">
5151
<ul class="nav-stacked sidebar-items">
5252
{% for addon_key,addon in group.addons %}
5353
<li class="nav-item sidebar-addon {{ addon.active ? 'active' }}">
5454
<a title="{{ trans(addon.title) }}"
55+
{% if addon.sections is not defined %}
56+
href="{{ addon.href }}" title="{{ trans(addon.title) }}"
57+
{% endif %}
5558
class="sidebar-title sidebar-addon-link"
5659
data-toggle="collapse"
5760
aria-expanded="{{ addon.active ? 'true' : 'false' }}"
@@ -60,21 +63,24 @@
6063
<i class="fa fa-circle"></i>
6164
{{ trans(addon.title) }}
6265
</span>
63-
<i class="fa fa-chevron-down"></i>
66+
{% if addon.sections is defined %}
67+
<i class="fa fa-chevron-down"></i>
68+
{% endif %}
6469
</a>
6570
<div class="sidebar-sublist collapse {{ addon.active ? 'in' }} ml-2"
6671
id="{{ addon_key }}" aria-expanded="false">
6772
<ul class="flex-column nav">
68-
{% for section in addon.sections %}
69-
<li class="sub-item {{ section.active ? 'active' }}">
70-
<a href="{{ section.href }}" title="{{ trans(section.title) }}"
71-
class="text-truncate sidebar-title">
72-
<i class="fa fa-circle"></i>
73-
{{ trans(section.title) }}
74-
</a>
75-
</li>
76-
77-
{% endfor %}
73+
{% if addon.sections is defined %}
74+
{% for section in addon.sections %}
75+
<li class="sub-item {{ section.active ? 'active' }}">
76+
<a href="{{ section.href }}" title="{{ trans(section.title) }}"
77+
class="text-truncate sidebar-title">
78+
<i class="fa fa-circle"></i>
79+
{{ trans(section.title) }}
80+
</a>
81+
</li>
82+
{% endfor %}
83+
{% endif %}
7884
</ul>
7985
</div>
8086
</li>

0 commit comments

Comments
 (0)