NavMenu Addon For Elementor - Version 1.0.1

Version Description

  • NEW: Revised the plugin structure to me more modular and facilitate more element additions.
  • NEW: Created a plugin specific elements category.
  • NEW: Added option to select a menu location (up to 2) with both being mobile ready!
  • NEW: Added a site branding module - you can now insert either the Site Title or the set Custom Logo in your headers.
  • TWEAKS: Tiny but significant tweaks to make the whole experience more user friendly :)
Download this release

Release Info

Developer WPDevHQ
Plugin Icon wp plugin NavMenu Addon For Elementor
Version 1.0.1
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.1

assets/css/{default.css → editor.css} RENAMED
@@ -1,235 +1,227 @@
1
- /*--------------------------------------------------------------
2
- Menus
3
- --------------------------------------------------------------*/
4
- .elementor-menu {
5
- display: none;
6
- -webkit-flex: 0 1 100%;
7
- -ms-flex: 0 1 100%;
8
- flex: 0 1 100%;
9
- margin: 0;
10
- clear: both;
11
- }
12
-
13
- .elementor-menu.eltoggled-on,
14
- .no-js .elementor-menu {
15
- display: block;
16
- }
17
-
18
- .elementor-navigation ul {
19
- list-style: none;
20
- margin: 0;
21
- }
22
-
23
- .elementor-navigation li {
24
- position: relative;
25
- display: block;
26
- }
27
-
28
- .elementor-navigation a {
29
- display: block;
30
- line-height: 1.3125;
31
- outline-offset: -1px;
32
- padding: 0.84375em 0;
33
- }
34
-
35
- .elementor-nav-menu a {
36
- color: #ffffff;
37
- }
38
- .elementor-nav-menu .menu-item a,
39
- .elementor-nav-menu .current-menu-item a,
40
- .elementor-widget-elementor-navmenu .elementor-nav-menu .menu-item a {
41
- background-color: #00215e;
42
- }
43
-
44
- .elementor-navigation .current-menu-item > a,
45
- .elementor-navigation .current-menu-ancestor > a {
46
- font-weight: 700;
47
- }
48
-
49
- .elementor-navigation ul ul {
50
- display: none;
51
- }
52
-
53
- .elementor-navigation ul li,
54
- .elementor-navigation ul ul li {
55
- text-align: left;
56
- }
57
-
58
- .no-js .elementor-navigation ul ul {
59
- display: block;
60
- }
61
-
62
- .elementor-navigation ul .eltoggled-on {
63
- display: block;
64
- }
65
-
66
- .elementor-navigation .menu-item-has-children > a {
67
- margin-right: 56px;
68
- }
69
-
70
- .eldropdown-toggle {
71
- background-color: transparent;
72
- border: 0;
73
- border-radius: 0;
74
- color: #1a1a1a;
75
- content: "";
76
- height: 48px;
77
- padding: 0;
78
- position: absolute;
79
- right: 0;
80
- text-transform: none;
81
- top: 0;
82
- width: 48px;
83
- }
84
-
85
- .eldropdown-toggle:after {
86
- border: 0 solid #d1d1d1;
87
- border-left-width: 1px;
88
- content: "\f107";
89
- font-family: FontAwesome;
90
- font-size: 24px;
91
- left: 1px;
92
- position: relative;
93
- width: 48px;
94
- }
95
-
96
- .eldropdown-toggle:focus {
97
- outline: thin dotted;
98
- outline-offset: -1px;
99
- }
100
-
101
- .eldropdown-toggle:focus:after {
102
- border-color: transparent;
103
- }
104
-
105
- .eldropdown-toggle.eltoggled-on:after {
106
- content: "\f106";
107
- }
108
-
109
- .elementor-menu-toggle {
110
- font-size: 14px;
111
- font-size: 1rem;
112
- margin: 1.076923077em 0;
113
- padding: 0.569230769em 0.769230769em;
114
- clear: both;
115
- }
116
-
117
- .elementor-menu-toggle {
118
- font-size: 24px;
119
- font-size: 1.5rem;
120
- }
121
-
122
- .no-js .elementor-menu-toggle {
123
- display: none;
124
- }
125
-
126
- .elementor-menu-toggle:focus {
127
- outline: 0;
128
- }
129
-
130
- .elementor-menu-toggle.eltoggled-on:focus {
131
- outline: thin dotted;
132
- }
133
-
134
- @media screen and (min-width: 48em) {
135
- .elementor-menu-toggle {
136
- font-size: 16px;
137
- font-size: 1.0rem;
138
- margin: 1.3125em 0;
139
- padding: 0.8125em 0.875em 0.6875em;
140
- }
141
- }
142
-
143
- @media screen and (min-width: 56.875em) {
144
- .elementor-menu {
145
- display: block;
146
- -webkit-flex: 0 1 auto;
147
- -ms-flex: 0 1 auto;
148
- flex: 0 1 auto;
149
- }
150
-
151
- .elementor-navigation {
152
- margin: 0 -0.875em;
153
- }
154
-
155
- .elementor-navigation li {
156
- display: inline-block;
157
- }
158
-
159
- .elementor-navigation a {
160
- outline-offset: -8px;
161
- padding: 1em;
162
- white-space: nowrap;
163
- }
164
-
165
- .elementor-navigation ul ul {
166
- display: block;
167
- left: -999em;
168
- margin: 0;
169
- position: absolute;
170
- z-index: 99999;
171
- }
172
-
173
- .elementor-navigation ul ul ul {
174
- top: -1px;
175
- }
176
-
177
- .elementor-navigation ul ul ul:before,
178
- .elementor-navigation ul ul ul:after {
179
- border: 0;
180
- }
181
-
182
- .elementor-navigation ul ul a {
183
- white-space: normal;
184
- width: 12.6875em;
185
- }
186
-
187
- .elementor-navigation li:hover > ul,
188
- .elementor-navigation li.focus > ul {
189
- left: auto;
190
- right: 0;
191
- }
192
-
193
- .elementor-navigation ul ul li:hover > ul,
194
- .elementor-navigation ul ul li.focus > ul {
195
- left: auto;
196
- right: 100%;
197
- }
198
-
199
- .elementor-navigation .menu-item-has-children > a {
200
- margin: 0;
201
- padding-right: 2.25em;
202
- }
203
-
204
- .elementor-navigation .menu-item-has-children > a:after {
205
- content: "\f107";
206
- font-family: FontAwesome;
207
- position: absolute;
208
- right: 0.625em;
209
- top: 1.25em;
210
- }
211
-
212
- .elementor-navigation ul ul .menu-item-has-children > a {
213
- padding-right: 2.0625em;
214
- }
215
-
216
- .elementor-navigation ul ul .menu-item-has-children > a:after {
217
- right: 0.5625em;
218
- top: 0.875em;
219
- -webkit-transform: rotate(90deg);
220
- -moz-transform: rotate(90deg);
221
- -ms-transform: rotate(90deg);
222
- transform: rotate(90deg);
223
- }
224
- .eldropdown-toggle,
225
- .elementor-navigation ul .eldropdown-toggle.eltoggled-on,
226
- .elementor-menu-toggle {
227
- display: none;
228
- }
229
- }
230
-
231
- @media screen and (max-width: 56.874em) {
232
- .elementor-navigation a {
233
- padding-left: 1em;
234
- }
235
  }
1
+ .elementor-menu {
2
+ display: none;
3
+ -webkit-flex: 0 1 100%;
4
+ -ms-flex: 0 1 100%;
5
+ flex: 0 1 100%;
6
+ margin: 0;
7
+ clear: both;
8
+ }
9
+
10
+ .elementor-menu.eltoggled-on,
11
+ .no-js .elementor-menu {
12
+ display: block;
13
+ }
14
+
15
+ .elementor-navigation ul {
16
+ list-style: none;
17
+ margin: 0;
18
+ }
19
+
20
+ .elementor-navigation li {
21
+ position: relative;
22
+ display: block;
23
+ }
24
+
25
+ .elementor-navigation a {
26
+ display: block;
27
+ line-height: 1.3125;
28
+ outline-offset: -1px;
29
+ padding: 0.84375em 0;
30
+ }
31
+
32
+ .elementor-nav-menu a {
33
+ color: #ffffff;
34
+ }
35
+
36
+ .elementor-navigation .current-menu-item > a,
37
+ .elementor-navigation .current-menu-ancestor > a {
38
+ font-weight: 700;
39
+ }
40
+
41
+ .elementor-navigation ul ul {
42
+ display: none;
43
+ }
44
+
45
+ .elementor-navigation ul li,
46
+ .elementor-navigation ul ul li {
47
+ text-align: left;
48
+ }
49
+
50
+ .no-js .elementor-navigation ul ul {
51
+ display: block;
52
+ }
53
+
54
+ .elementor-navigation ul .eltoggled-on {
55
+ display: block;
56
+ }
57
+
58
+ .elementor-navigation .menu-item-has-children > a {
59
+ margin-right: 56px;
60
+ }
61
+
62
+ .eldropdown-toggle {
63
+ background-color: transparent;
64
+ border: 0;
65
+ border-radius: 0;
66
+ color: #1a1a1a;
67
+ content: "";
68
+ height: 48px;
69
+ padding: 0;
70
+ position: absolute;
71
+ right: 0;
72
+ text-transform: none;
73
+ top: 0;
74
+ width: 48px;
75
+ }
76
+
77
+ .eldropdown-toggle:after {
78
+ border: 0 solid #d1d1d1;
79
+ border-left-width: 1px;
80
+ content: "\f107";
81
+ font-family: FontAwesome;
82
+ font-size: 24px;
83
+ left: 1px;
84
+ position: relative;
85
+ width: 48px;
86
+ }
87
+
88
+ .eldropdown-toggle:focus {
89
+ outline: thin dotted;
90
+ outline-offset: -1px;
91
+ }
92
+
93
+ .eldropdown-toggle:focus:after {
94
+ border-color: transparent;
95
+ }
96
+
97
+ .eldropdown-toggle.eltoggled-on:after {
98
+ content: "\f106";
99
+ }
100
+
101
+ .elementor-menu-toggle {
102
+ font-size: 14px;
103
+ font-size: 1rem;
104
+ margin: 1.076923077em 0;
105
+ padding: 0.569230769em 0.769230769em;
106
+ clear: both;
107
+ }
108
+
109
+ .elementor-menu-toggle {
110
+ font-size: 24px;
111
+ font-size: 1.5rem;
112
+ }
113
+
114
+ .no-js .elementor-menu-toggle {
115
+ display: none;
116
+ }
117
+
118
+ .elementor-menu-toggle:focus {
119
+ outline: 0;
120
+ }
121
+
122
+ .elementor-menu-toggle.eltoggled-on:focus {
123
+ outline: thin dotted;
124
+ }
125
+
126
+ @media screen and (min-width: 48em) {
127
+ .elementor-menu-toggle {
128
+ font-size: 16px;
129
+ font-size: 1.0rem;
130
+ margin: 1.3125em 0;
131
+ padding: 0.8125em 0.875em 0.6875em;
132
+ }
133
+ }
134
+
135
+ @media screen and (min-width: 56.875em) {
136
+ .elementor-menu {
137
+ display: block;
138
+ -webkit-flex: 0 1 auto;
139
+ -ms-flex: 0 1 auto;
140
+ flex: 0 1 auto;
141
+ }
142
+
143
+ .elementor-navigation {
144
+ margin: 0 -0.875em;
145
+ }
146
+
147
+ .elementor-navigation li {
148
+ display: inline-block;
149
+ }
150
+
151
+ .elementor-navigation a {
152
+ outline-offset: -8px;
153
+ padding: 1em;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .elementor-navigation ul ul {
158
+ display: block;
159
+ left: -999em;
160
+ margin: 0;
161
+ position: absolute;
162
+ z-index: 99999;
163
+ }
164
+
165
+ .elementor-navigation ul ul ul {
166
+ top: -1px;
167
+ }
168
+
169
+ .elementor-navigation ul ul ul:before,
170
+ .elementor-navigation ul ul ul:after {
171
+ border: 0;
172
+ }
173
+
174
+ .elementor-navigation ul ul a {
175
+ white-space: normal;
176
+ width: 12.6875em;
177
+ }
178
+
179
+ .elementor-navigation li:hover > ul,
180
+ .elementor-navigation li.focus > ul {
181
+ left: auto;
182
+ right: 0;
183
+ }
184
+
185
+ .elementor-navigation ul ul li:hover > ul,
186
+ .elementor-navigation ul ul li.focus > ul {
187
+ left: auto;
188
+ right: 100%;
189
+ }
190
+
191
+ .elementor-navigation .menu-item-has-children > a {
192
+ margin: 0;
193
+ padding-right: 2.25em;
194
+ }
195
+
196
+ .elementor-navigation .menu-item-has-children > a:after {
197
+ content: "\f107";
198
+ font-family: FontAwesome;
199
+ position: absolute;
200
+ right: 0.625em;
201
+ top: 1.25em;
202
+ }
203
+
204
+ .elementor-navigation ul ul .menu-item-has-children > a {
205
+ padding-right: 2.0625em;
206
+ }
207
+
208
+ .elementor-navigation ul ul .menu-item-has-children > a:after {
209
+ right: 0.5625em;
210
+ top: 0.875em;
211
+ -webkit-transform: rotate(90deg);
212
+ -moz-transform: rotate(90deg);
213
+ -ms-transform: rotate(90deg);
214
+ transform: rotate(90deg);
215
+ }
216
+ .eldropdown-toggle,
217
+ .elementor-navigation ul .eldropdown-toggle.eltoggled-on,
218
+ .elementor-menu-toggle {
219
+ display: none;
220
+ }
221
+ }
222
+
223
+ @media screen and (max-width: 56.874em) {
224
+ .elementor-navigation a {
225
+ padding-left: 1em;
226
+ }
 
 
 
 
 
 
 
 
227
  }
assets/css/editor.min.css ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-menu {
2
+ display: none;
3
+ -webkit-flex: 0 1 100%;
4
+ -ms-flex: 0 1 100%;
5
+ flex: 0 1 100%;
6
+ margin: 0;
7
+ clear: both;
8
+ }
9
+
10
+ .elementor-menu.eltoggled-on,
11
+ .no-js .elementor-menu {
12
+ display: block;
13
+ }
14
+
15
+ .elementor-navigation ul {
16
+ list-style: none;
17
+ margin: 0;
18
+ }
19
+
20
+ .elementor-navigation li {
21
+ position: relative;
22
+ display: block;
23
+ }
24
+
25
+ .elementor-navigation a {
26
+ display: block;
27
+ line-height: 1.3125;
28
+ outline-offset: -1px;
29
+ padding: 0.84375em 0;
30
+ }
31
+
32
+ .elementor-nav-menu a {
33
+ color: #ffffff;
34
+ }
35
+
36
+ .elementor-navigation .current-menu-item > a,
37
+ .elementor-navigation .current-menu-ancestor > a {
38
+ font-weight: 700;
39
+ }
40
+
41
+ .elementor-navigation ul ul {
42
+ display: none;
43
+ }
44
+
45
+ .elementor-navigation ul li,
46
+ .elementor-navigation ul ul li {
47
+ text-align: left;
48
+ }
49
+
50
+ .no-js .elementor-navigation ul ul {
51
+ display: block;
52
+ }
53
+
54
+ .elementor-navigation ul .eltoggled-on {
55
+ display: block;
56
+ }
57
+
58
+ .elementor-navigation .menu-item-has-children > a {
59
+ margin-right: 56px;
60
+ }
61
+
62
+ .eldropdown-toggle {
63
+ background-color: transparent;
64
+ border: 0;
65
+ border-radius: 0;
66
+ color: #1a1a1a;
67
+ content: "";
68
+ height: 48px;
69
+ padding: 0;
70
+ position: absolute;
71
+ right: 0;
72
+ text-transform: none;
73
+ top: 0;
74
+ width: 48px;
75
+ }
76
+
77
+ .eldropdown-toggle:after {
78
+ border: 0 solid #d1d1d1;
79
+ border-left-width: 1px;
80
+ content: "\f107";
81
+ font-family: FontAwesome;
82
+ font-size: 24px;
83
+ left: 1px;
84
+ position: relative;
85
+ width: 48px;
86
+ }
87
+
88
+ .eldropdown-toggle:focus {
89
+ outline: thin dotted;
90
+ outline-offset: -1px;
91
+ }
92
+
93
+ .eldropdown-toggle:focus:after {
94
+ border-color: transparent;
95
+ }
96
+
97
+ .eldropdown-toggle.eltoggled-on:after {
98
+ content: "\f106";
99
+ }
100
+
101
+ .elementor-menu-toggle {
102
+ font-size: 14px;
103
+ font-size: 1rem;
104
+ margin: 1.076923077em 0;
105
+ padding: 0.569230769em 0.769230769em;
106
+ clear: both;
107
+ }
108
+
109
+ .elementor-menu-toggle {
110
+ font-size: 24px;
111
+ font-size: 1.5rem;
112
+ }
113
+
114
+ .no-js .elementor-menu-toggle {
115
+ display: none;
116
+ }
117
+
118
+ .elementor-menu-toggle:focus {
119
+ outline: 0;
120
+ }
121
+
122
+ .elementor-menu-toggle.eltoggled-on:focus {
123
+ outline: thin dotted;
124
+ }
125
+
126
+ @media screen and (min-width: 48em) {
127
+ .elementor-menu-toggle {
128
+ font-size: 16px;
129
+ font-size: 1.0rem;
130
+ margin: 1.3125em 0;
131
+ padding: 0.8125em 0.875em 0.6875em;
132
+ }
133
+ }
134
+
135
+ @media screen and (min-width: 56.875em) {
136
+ .elementor-menu {
137
+ display: block;
138
+ -webkit-flex: 0 1 auto;
139
+ -ms-flex: 0 1 auto;
140
+ flex: 0 1 auto;
141
+ }
142
+
143
+ .elementor-navigation {
144
+ margin: 0 -0.875em;
145
+ }
146
+
147
+ .elementor-navigation li {
148
+ display: inline-block;
149
+ }
150
+
151
+ .elementor-navigation a {
152
+ outline-offset: -8px;
153
+ padding: 1em;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .elementor-navigation ul ul {
158
+ display: block;
159
+ left: -999em;
160
+ margin: 0;
161
+ position: absolute;
162
+ z-index: 99999;
163
+ }
164
+
165
+ .elementor-navigation ul ul ul {
166
+ top: -1px;
167
+ }
168
+
169
+ .elementor-navigation ul ul ul:before,
170
+ .elementor-navigation ul ul ul:after {
171
+ border: 0;
172
+ }
173
+
174
+ .elementor-navigation ul ul a {
175
+ white-space: normal;
176
+ width: 12.6875em;
177
+ }
178
+
179
+ .elementor-navigation li:hover > ul,
180
+ .elementor-navigation li.focus > ul {
181
+ left: auto;
182
+ right: 0;
183
+ }
184
+
185
+ .elementor-navigation ul ul li:hover > ul,
186
+ .elementor-navigation ul ul li.focus > ul {
187
+ left: auto;
188
+ right: 100%;
189
+ }
190
+
191
+ .elementor-navigation .menu-item-has-children > a {
192
+ margin: 0;
193
+ padding-right: 2.25em;
194
+ }
195
+
196
+ .elementor-navigation .menu-item-has-children > a:after {
197
+ content: "\f107";
198
+ font-family: FontAwesome;
199
+ position: absolute;
200
+ right: 0.625em;
201
+ top: 1.25em;
202
+ }
203
+
204
+ .elementor-navigation ul ul .menu-item-has-children > a {
205
+ padding-right: 2.0625em;
206
+ }
207
+
208
+ .elementor-navigation ul ul .menu-item-has-children > a:after {
209
+ right: 0.5625em;
210
+ top: 0.875em;
211
+ -webkit-transform: rotate(90deg);
212
+ -moz-transform: rotate(90deg);
213
+ -ms-transform: rotate(90deg);
214
+ transform: rotate(90deg);
215
+ }
216
+ .eldropdown-toggle,
217
+ .elementor-navigation ul .eldropdown-toggle.eltoggled-on,
218
+ .elementor-menu-toggle {
219
+ display: none;
220
+ }
221
+ }
222
+
223
+ @media screen and (max-width: 56.874em) {
224
+ .elementor-navigation a {
225
+ padding-left: 1em;
226
+ }
227
+ }
assets/css/frontend.css ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-menu {
2
+ display: none;
3
+ -webkit-flex: 0 1 100%;
4
+ -ms-flex: 0 1 100%;
5
+ flex: 0 1 100%;
6
+ margin: 0;
7
+ clear: both;
8
+ }
9
+
10
+ .elementor-menu.eltoggled-on,
11
+ .no-js .elementor-menu {
12
+ display: block;
13
+ }
14
+
15
+ .elementor-navigation ul {
16
+ list-style: none;
17
+ margin: 0;
18
+ }
19
+
20
+ .elementor-navigation li {
21
+ position: relative;
22
+ display: block;
23
+ }
24
+
25
+ .elementor-navigation a {
26
+ display: block;
27
+ line-height: 1.3125;
28
+ outline-offset: -1px;
29
+ padding: 0.84375em 0;
30
+ }
31
+
32
+ .elementor-nav-menu a {
33
+ color: #ffffff;
34
+ }
35
+
36
+ .elementor-navigation .current-menu-item > a,
37
+ .elementor-navigation .current-menu-ancestor > a {
38
+ font-weight: 700;
39
+ }
40
+
41
+ .elementor-navigation ul ul {
42
+ display: none;
43
+ }
44
+
45
+ .elementor-navigation ul li,
46
+ .elementor-navigation ul ul li {
47
+ text-align: left;
48
+ }
49
+
50
+ .no-js .elementor-navigation ul ul {
51
+ display: block;
52
+ }
53
+
54
+ .elementor-navigation ul .eltoggled-on {
55
+ display: block;
56
+ }
57
+
58
+ .elementor-navigation .menu-item-has-children > a {
59
+ margin-right: 56px;
60
+ }
61
+
62
+ .eldropdown-toggle {
63
+ background-color: transparent;
64
+ border: 0;
65
+ border-radius: 0;
66
+ color: #1a1a1a;
67
+ content: "";
68
+ height: 48px;
69
+ padding: 0;
70
+ position: absolute;
71
+ right: 0;
72
+ text-transform: none;
73
+ top: 0;
74
+ width: 48px;
75
+ }
76
+
77
+ .eldropdown-toggle:after {
78
+ border: 0 solid #d1d1d1;
79
+ border-left-width: 1px;
80
+ content: "\f107";
81
+ font-family: FontAwesome;
82
+ font-size: 24px;
83
+ left: 1px;
84
+ position: relative;
85
+ width: 48px;
86
+ }
87
+
88
+ .eldropdown-toggle:focus {
89
+ outline: thin dotted;
90
+ outline-offset: -1px;
91
+ }
92
+
93
+ .eldropdown-toggle:focus:after {
94
+ border-color: transparent;
95
+ }
96
+
97
+ .eldropdown-toggle.eltoggled-on:after {
98
+ content: "\f106";
99
+ }
100
+
101
+ .elementor-menu-toggle {
102
+ font-size: 14px;
103
+ font-size: 1rem;
104
+ margin: 1.076923077em 0;
105
+ padding: 0.569230769em 0.769230769em;
106
+ clear: both;
107
+ }
108
+
109
+ .elementor-menu-toggle {
110
+ font-size: 24px;
111
+ font-size: 1.5rem;
112
+ }
113
+
114
+ .no-js .elementor-menu-toggle {
115
+ display: none;
116
+ }
117
+
118
+ .elementor-menu-toggle:focus {
119
+ outline: 0;
120
+ }
121
+
122
+ .elementor-menu-toggle.eltoggled-on:focus {
123
+ outline: thin dotted;
124
+ }
125
+
126
+ @media screen and (min-width: 48em) {
127
+ .elementor-menu-toggle {
128
+ font-size: 16px;
129
+ font-size: 1.0rem;
130
+ margin: 1.3125em 0;
131
+ padding: 0.8125em 0.875em 0.6875em;
132
+ }
133
+ }
134
+
135
+ @media screen and (min-width: 56.875em) {
136
+ .elementor-menu {
137
+ display: block;
138
+ -webkit-flex: 0 1 auto;
139
+ -ms-flex: 0 1 auto;
140
+ flex: 0 1 auto;
141
+ }
142
+
143
+ .elementor-navigation {
144
+ margin: 0 -0.875em;
145
+ }
146
+
147
+ .elementor-navigation li {
148
+ display: inline-block;
149
+ }
150
+
151
+ .elementor-navigation a {
152
+ outline-offset: -8px;
153
+ padding: 1em;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .elementor-navigation ul ul {
158
+ display: block;
159
+ left: -999em;
160
+ margin: 0;
161
+ position: absolute;
162
+ z-index: 99999;
163
+ }
164
+
165
+ .elementor-navigation ul ul ul {
166
+ top: -1px;
167
+ }
168
+
169
+ .elementor-navigation ul ul ul:before,
170
+ .elementor-navigation ul ul ul:after {
171
+ border: 0;
172
+ }
173
+
174
+ .elementor-navigation ul ul a {
175
+ white-space: normal;
176
+ width: 12.6875em;
177
+ }
178
+
179
+ .elementor-navigation li:hover > ul,
180
+ .elementor-navigation li.focus > ul {
181
+ left: auto;
182
+ right: 0;
183
+ }
184
+
185
+ .elementor-navigation ul ul li:hover > ul,
186
+ .elementor-navigation ul ul li.focus > ul {
187
+ left: auto;
188
+ right: 100%;
189
+ }
190
+
191
+ .elementor-navigation .menu-item-has-children > a {
192
+ margin: 0;
193
+ padding-right: 2.25em;
194
+ }
195
+
196
+ .elementor-navigation .menu-item-has-children > a:after {
197
+ content: "\f107";
198
+ font-family: FontAwesome;
199
+ position: absolute;
200
+ right: 0.625em;
201
+ top: 1.25em;
202
+ }
203
+
204
+ .elementor-navigation ul ul .menu-item-has-children > a {
205
+ padding-right: 2.0625em;
206
+ }
207
+
208
+ .elementor-navigation ul ul .menu-item-has-children > a:after {
209
+ right: 0.5625em;
210
+ top: 0.875em;
211
+ -webkit-transform: rotate(90deg);
212
+ -moz-transform: rotate(90deg);
213
+ -ms-transform: rotate(90deg);
214
+ transform: rotate(90deg);
215
+ }
216
+ .eldropdown-toggle,
217
+ .elementor-navigation ul .eldropdown-toggle.eltoggled-on,
218
+ .elementor-menu-toggle {
219
+ display: none;
220
+ }
221
+ }
222
+
223
+ @media screen and (max-width: 56.874em) {
224
+ .elementor-navigation a {
225
+ padding-left: 1em;
226
+ }
227
+ }
assets/css/frontend.min.css ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .elementor-menu {
2
+ display: none;
3
+ -webkit-flex: 0 1 100%;
4
+ -ms-flex: 0 1 100%;
5
+ flex: 0 1 100%;
6
+ margin: 0;
7
+ clear: both;
8
+ }
9
+
10
+ .elementor-menu.eltoggled-on,
11
+ .no-js .elementor-menu {
12
+ display: block;
13
+ }
14
+
15
+ .elementor-navigation ul {
16
+ list-style: none;
17
+ margin: 0;
18
+ }
19
+
20
+ .elementor-navigation li {
21
+ position: relative;
22
+ display: block;
23
+ }
24
+
25
+ .elementor-navigation a {
26
+ display: block;
27
+ line-height: 1.3125;
28
+ outline-offset: -1px;
29
+ padding: 0.84375em 0;
30
+ }
31
+
32
+ .elementor-nav-menu a {
33
+ color: #ffffff;
34
+ }
35
+
36
+ .elementor-navigation .current-menu-item > a,
37
+ .elementor-navigation .current-menu-ancestor > a {
38
+ font-weight: 700;
39
+ }
40
+
41
+ .elementor-navigation ul ul {
42
+ display: none;
43
+ }
44
+
45
+ .elementor-navigation ul li,
46
+ .elementor-navigation ul ul li {
47
+ text-align: left;
48
+ }
49
+
50
+ .no-js .elementor-navigation ul ul {
51
+ display: block;
52
+ }
53
+
54
+ .elementor-navigation ul .eltoggled-on {
55
+ display: block;
56
+ }
57
+
58
+ .elementor-navigation .menu-item-has-children > a {
59
+ margin-right: 56px;
60
+ }
61
+
62
+ .eldropdown-toggle {
63
+ background-color: transparent;
64
+ border: 0;
65
+ border-radius: 0;
66
+ color: #1a1a1a;
67
+ content: "";
68
+ height: 48px;
69
+ padding: 0;
70
+ position: absolute;
71
+ right: 0;
72
+ text-transform: none;
73
+ top: 0;
74
+ width: 48px;
75
+ }
76
+
77
+ .eldropdown-toggle:after {
78
+ border: 0 solid #d1d1d1;
79
+ border-left-width: 1px;
80
+ content: "\f107";
81
+ font-family: FontAwesome;
82
+ font-size: 24px;
83
+ left: 1px;
84
+ position: relative;
85
+ width: 48px;
86
+ }
87
+
88
+ .eldropdown-toggle:focus {
89
+ outline: thin dotted;
90
+ outline-offset: -1px;
91
+ }
92
+
93
+ .eldropdown-toggle:focus:after {
94
+ border-color: transparent;
95
+ }
96
+
97
+ .eldropdown-toggle.eltoggled-on:after {
98
+ content: "\f106";
99
+ }
100
+
101
+ .elementor-menu-toggle {
102
+ font-size: 14px;
103
+ font-size: 1rem;
104
+ margin: 1.076923077em 0;
105
+ padding: 0.569230769em 0.769230769em;
106
+ clear: both;
107
+ }
108
+
109
+ .elementor-menu-toggle {
110
+ font-size: 24px;
111
+ font-size: 1.5rem;
112
+ }
113
+
114
+ .no-js .elementor-menu-toggle {
115
+ display: none;
116
+ }
117
+
118
+ .elementor-menu-toggle:focus {
119
+ outline: 0;
120
+ }
121
+
122
+ .elementor-menu-toggle.eltoggled-on:focus {
123
+ outline: thin dotted;
124
+ }
125
+
126
+ @media screen and (min-width: 48em) {
127
+ .elementor-menu-toggle {
128
+ font-size: 16px;
129
+ font-size: 1.0rem;
130
+ margin: 1.3125em 0;
131
+ padding: 0.8125em 0.875em 0.6875em;
132
+ }
133
+ }
134
+
135
+ @media screen and (min-width: 56.875em) {
136
+ .elementor-menu {
137
+ display: block;
138
+ -webkit-flex: 0 1 auto;
139
+ -ms-flex: 0 1 auto;
140
+ flex: 0 1 auto;
141
+ }
142
+
143
+ .elementor-navigation {
144
+ margin: 0 -0.875em;
145
+ }
146
+
147
+ .elementor-navigation li {
148
+ display: inline-block;
149
+ }
150
+
151
+ .elementor-navigation a {
152
+ outline-offset: -8px;
153
+ padding: 1em;
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .elementor-navigation ul ul {
158
+ display: block;
159
+ left: -999em;
160
+ margin: 0;
161
+ position: absolute;
162
+ z-index: 99999;
163
+ }
164
+
165
+ .elementor-navigation ul ul ul {
166
+ top: -1px;
167
+ }
168
+
169
+ .elementor-navigation ul ul ul:before,
170
+ .elementor-navigation ul ul ul:after {
171
+ border: 0;
172
+ }
173
+
174
+ .elementor-navigation ul ul a {
175
+ white-space: normal;
176
+ width: 12.6875em;
177
+ }
178
+
179
+ .elementor-navigation li:hover > ul,
180
+ .elementor-navigation li.focus > ul {
181
+ left: auto;
182
+ right: 0;
183
+ }
184
+
185
+ .elementor-navigation ul ul li:hover > ul,
186
+ .elementor-navigation ul ul li.focus > ul {
187
+ left: auto;
188
+ right: 100%;
189
+ }
190
+
191
+ .elementor-navigation .menu-item-has-children > a {
192
+ margin: 0;
193
+ padding-right: 2.25em;
194
+ }
195
+
196
+ .elementor-navigation .menu-item-has-children > a:after {
197
+ content: "\f107";
198
+ font-family: FontAwesome;
199
+ position: absolute;
200
+ right: 0.625em;
201
+ top: 1.25em;
202
+ }
203
+
204
+ .elementor-navigation ul ul .menu-item-has-children > a {
205
+ padding-right: 2.0625em;
206
+ }
207
+
208
+ .elementor-navigation ul ul .menu-item-has-children > a:after {
209
+ right: 0.5625em;
210
+ top: 0.875em;
211
+ -webkit-transform: rotate(90deg);
212
+ -moz-transform: rotate(90deg);
213
+ -ms-transform: rotate(90deg);
214
+ transform: rotate(90deg);
215
+ }
216
+ .eldropdown-toggle,
217
+ .elementor-navigation ul .eldropdown-toggle.eltoggled-on,
218
+ .elementor-menu-toggle {
219
+ display: none;
220
+ }
221
+ }
222
+
223
+ @media screen and (max-width: 56.874em) {
224
+ .elementor-navigation a {
225
+ padding-left: 1em;
226
+ }
227
+ }
assets/js/{default.js → editor.js} RENAMED
File without changes
assets/js/editor.min.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global screenReaderText */
2
+ /**
3
+ * Theme functions file.
4
+ *
5
+ * Contains handlers for navigation and widget area.
6
+ */
7
+
8
+ ( function( $ ) {
9
+ var body, menuArea, elmenuToggle, elementorNavigation, elementorHeaderMenu, resizeTimer;
10
+
11
+ function initElementorNavigation( container ) {
12
+
13
+ // Add dropdown toggle that displays child menu items.
14
+ var eldropdownToggle = $( '<button />', {
15
+ 'class': 'eldropdown-toggle',
16
+ 'aria-expanded': false
17
+ } ).append( $( '<span />', {
18
+ 'class': 'screen-reader-text',
19
+ text: elementorScreenReaderText.expand
20
+ } ) );
21
+
22
+ container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
23
+
24
+ // Toggle buttons and submenu items with active children menu items.
25
+ container.find( '.current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
26
+ container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
27
+
28
+ // Add menu items with submenus to aria-haspopup="true".
29
+ container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
30
+
31
+ container.find( '.eldropdown-toggle' ).click( function( e ) {
32
+ var _this = $( this ),
33
+ screenReaderSpan = _this.find( '.screen-reader-text' );
34
+
35
+ e.preventDefault();
36
+ _this.toggleClass( 'eltoggled-on' );
37
+ _this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
38
+
39
+ // jscs:disable
40
+ _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
41
+ // jscs:enable
42
+ screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
43
+ } );
44
+ }
45
+ initElementorNavigation( $( '.elementor-navigation' ) );
46
+
47
+ menuArea = $( '#elementor-header' );
48
+ elmenuToggle = menuArea.find( '#elementor-menu-toggle' );
49
+ elementorHeaderMenu = menuArea.find( '#elementor-menu' );
50
+ elementorNavigation = menuArea.find( '#elementor-navigation' );
51
+
52
+ // Enable elmenuToggle.
53
+ ( function() {
54
+
55
+ // Return early if elmenuToggle is missing.
56
+ if ( ! elmenuToggle.length ) {
57
+ return;
58
+ }
59
+
60
+ // Add an initial values for the attribute.
61
+ elmenuToggle.add( elementorNavigation ).attr( 'aria-expanded', 'false' );
62
+
63
+ elmenuToggle.on( 'click.actions', function() {
64
+ $( this ).add( elementorHeaderMenu ).toggleClass( 'eltoggled-on' );
65
+
66
+ // jscs:disable
67
+ $( this ).add( elementorNavigation ).attr( 'aria-expanded', $( this ).add( elementorNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
68
+ // jscs:enable
69
+ } );
70
+ } )();
71
+
72
+ // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
73
+ ( function() {
74
+ if ( ! elementorNavigation.length || ! elementorNavigation.children().length ) {
75
+ return;
76
+ }
77
+
78
+ // Toggle `focus` class to allow submenu access on tablets.
79
+ function toggleFocusClassTouchScreen() {
80
+ if ( window.innerWidth >= 910 ) {
81
+ $( document.body ).on( 'touchstart.actions', function( e ) {
82
+ if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
83
+ $( '.elementor-navigation li' ).removeClass( 'focus' );
84
+ }
85
+ } );
86
+ elementorNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
87
+ var el = $( this ).parent( 'li' );
88
+
89
+ if ( ! el.hasClass( 'focus' ) ) {
90
+ e.preventDefault();
91
+ el.toggleClass( 'focus' );
92
+ el.siblings( '.focus' ).removeClass( 'focus' );
93
+ }
94
+ } );
95
+ } else {
96
+ elementorNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
97
+ }
98
+ }
99
+
100
+ if ( 'ontouchstart' in window ) {
101
+ $( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
102
+ toggleFocusClassTouchScreen();
103
+ }
104
+
105
+ elementorNavigation.find( 'a' ).on( 'focus.actions blur.actions', function() {
106
+ $( this ).parents( '.menu-item' ).toggleClass( 'focus' );
107
+ } );
108
+ } )();
109
+
110
+ // Add the default ARIA attributes for the menu toggle and the navigations.
111
+ function onResizeARIA() {
112
+ if ( window.innerWidth < 910 ) {
113
+ if ( elmenuToggle.hasClass( 'eltoggled-on' ) ) {
114
+ elmenuToggle.attr( 'aria-expanded', 'true' );
115
+ } else {
116
+ elmenuToggle.attr( 'aria-expanded', 'false' );
117
+ }
118
+
119
+ if ( elementorHeaderMenu.hasClass( 'eltoggled-on' ) ) {
120
+ elementorNavigation.attr( 'aria-expanded', 'true' );
121
+ } else {
122
+ elementorNavigation.attr( 'aria-expanded', 'false' );
123
+ }
124
+
125
+ elmenuToggle.attr( 'aria-controls', 'site-navigation' );
126
+ } else {
127
+ elmenuToggle.removeAttr( 'aria-expanded' );
128
+ elementorNavigation.removeAttr( 'aria-expanded' );
129
+ elmenuToggle.removeAttr( 'aria-controls' );
130
+ }
131
+ }
132
+ } )( jQuery );
assets/js/frontend.js ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global screenReaderText */
2
+ /**
3
+ * Theme functions file.
4
+ *
5
+ * Contains handlers for navigation and widget area.
6
+ */
7
+
8
+ ( function( $ ) {
9
+ var body, menuArea, elmenuToggle, elementorNavigation, elementorHeaderMenu, resizeTimer;
10
+
11
+ function initElementorNavigation( container ) {
12
+
13
+ // Add dropdown toggle that displays child menu items.
14
+ var eldropdownToggle = $( '<button />', {
15
+ 'class': 'eldropdown-toggle',
16
+ 'aria-expanded': false
17
+ } ).append( $( '<span />', {
18
+ 'class': 'screen-reader-text',
19
+ text: elementorScreenReaderText.expand
20
+ } ) );
21
+
22
+ container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
23
+
24
+ // Toggle buttons and submenu items with active children menu items.
25
+ container.find( '.current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
26
+ container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
27
+
28
+ // Add menu items with submenus to aria-haspopup="true".
29
+ container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
30
+
31
+ container.find( '.eldropdown-toggle' ).click( function( e ) {
32
+ var _this = $( this ),
33
+ screenReaderSpan = _this.find( '.screen-reader-text' );
34
+
35
+ e.preventDefault();
36
+ _this.toggleClass( 'eltoggled-on' );
37
+ _this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
38
+
39
+ // jscs:disable
40
+ _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
41
+ // jscs:enable
42
+ screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
43
+ } );
44
+ }
45
+ initElementorNavigation( $( '.elementor-navigation' ) );
46
+
47
+ menuArea = $( '#elementor-header' );
48
+ elmenuToggle = menuArea.find( '#elementor-menu-toggle' );
49
+ elementorHeaderMenu = menuArea.find( '#elementor-menu' );
50
+ elementorNavigation = menuArea.find( '#elementor-navigation' );
51
+
52
+ // Enable elmenuToggle.
53
+ ( function() {
54
+
55
+ // Return early if elmenuToggle is missing.
56
+ if ( ! elmenuToggle.length ) {
57
+ return;
58
+ }
59
+
60
+ // Add an initial values for the attribute.
61
+ elmenuToggle.add( elementorNavigation ).attr( 'aria-expanded', 'false' );
62
+
63
+ elmenuToggle.on( 'click.actions', function() {
64
+ $( this ).add( elementorHeaderMenu ).toggleClass( 'eltoggled-on' );
65
+
66
+ // jscs:disable
67
+ $( this ).add( elementorNavigation ).attr( 'aria-expanded', $( this ).add( elementorNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
68
+ // jscs:enable
69
+ } );
70
+ } )();
71
+
72
+ // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
73
+ ( function() {
74
+ if ( ! elementorNavigation.length || ! elementorNavigation.children().length ) {
75
+ return;
76
+ }
77
+
78
+ // Toggle `focus` class to allow submenu access on tablets.
79
+ function toggleFocusClassTouchScreen() {
80
+ if ( window.innerWidth >= 910 ) {
81
+ $( document.body ).on( 'touchstart.actions', function( e ) {
82
+ if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
83
+ $( '.elementor-navigation li' ).removeClass( 'focus' );
84
+ }
85
+ } );
86
+ elementorNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
87
+ var el = $( this ).parent( 'li' );
88
+
89
+ if ( ! el.hasClass( 'focus' ) ) {
90
+ e.preventDefault();
91
+ el.toggleClass( 'focus' );
92
+ el.siblings( '.focus' ).removeClass( 'focus' );
93
+ }
94
+ } );
95
+ } else {
96
+ elementorNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
97
+ }
98
+ }
99
+
100
+ if ( 'ontouchstart' in window ) {
101
+ $( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
102
+ toggleFocusClassTouchScreen();
103
+ }
104
+
105
+ elementorNavigation.find( 'a' ).on( 'focus.actions blur.actions', function() {
106
+ $( this ).parents( '.menu-item' ).toggleClass( 'focus' );
107
+ } );
108
+ } )();
109
+
110
+ // Add the default ARIA attributes for the menu toggle and the navigations.
111
+ function onResizeARIA() {
112
+ if ( window.innerWidth < 910 ) {
113
+ if ( elmenuToggle.hasClass( 'eltoggled-on' ) ) {
114
+ elmenuToggle.attr( 'aria-expanded', 'true' );
115
+ } else {
116
+ elmenuToggle.attr( 'aria-expanded', 'false' );
117
+ }
118
+
119
+ if ( elementorHeaderMenu.hasClass( 'eltoggled-on' ) ) {
120
+ elementorNavigation.attr( 'aria-expanded', 'true' );
121
+ } else {
122
+ elementorNavigation.attr( 'aria-expanded', 'false' );
123
+ }
124
+
125
+ elmenuToggle.attr( 'aria-controls', 'site-navigation' );
126
+ } else {
127
+ elmenuToggle.removeAttr( 'aria-expanded' );
128
+ elementorNavigation.removeAttr( 'aria-expanded' );
129
+ elmenuToggle.removeAttr( 'aria-controls' );
130
+ }
131
+ }
132
+ } )( jQuery );
assets/js/frontend.min.js ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global screenReaderText */
2
+ /**
3
+ * Theme functions file.
4
+ *
5
+ * Contains handlers for navigation and widget area.
6
+ */
7
+
8
+ ( function( $ ) {
9
+ var body, menuAreaPrimary, elmenuTogglePrimary, elementorPrimaryNavigation, elementorPrimaryHeaderMenu, resizeTimer;
10
+
11
+ function initElementorPrimaryNavigation( container ) {
12
+
13
+ // Add dropdown toggle that displays child menu items.
14
+ var eldropdownToggle = $( '<button />', {
15
+ 'class': 'eldropdown-toggle',
16
+ 'aria-expanded': false
17
+ } ).append( $( '<span />', {
18
+ 'class': 'screen-reader-text',
19
+ text: elementorScreenReaderText.expand
20
+ } ) );
21
+
22
+ container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
23
+
24
+ // Toggle buttons and submenu items with active children menu items.
25
+ container.find( '.current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
26
+ container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
27
+
28
+ // Add menu items with submenus to aria-haspopup="true".
29
+ container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
30
+
31
+ container.find( '.eldropdown-toggle' ).click( function( e ) {
32
+ var _this = $( this ),
33
+ screenReaderSpan = _this.find( '.screen-reader-text' );
34
+
35
+ e.preventDefault();
36
+ _this.toggleClass( 'eltoggled-on' );
37
+ _this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
38
+
39
+ // jscs:disable
40
+ _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
41
+ // jscs:enable
42
+ screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
43
+ } );
44
+ }
45
+ initElementorPrimaryNavigation( $( '.elementor-navigation' ) );
46
+
47
+ menuAreaPrimary = $( '#elementor-header-primary' );
48
+ elmenuTogglePrimary = menuAreaPrimary.find( '#elementor-menu-toggle' );
49
+ elementorPrimaryHeaderMenu = menuAreaPrimary.find( '#elementor-menu' );
50
+ elementorPrimaryNavigation = menuAreaPrimary.find( '#elementor-navigation' );
51
+
52
+ // Enable elmenuTogglePrimary.
53
+ ( function() {
54
+
55
+ // Return early if elmenuTogglePrimary is missing.
56
+ if ( ! elmenuTogglePrimary.length ) {
57
+ return;
58
+ }
59
+
60
+ // Add an initial values for the attribute.
61
+ elmenuTogglePrimary.add( elementorPrimaryNavigation ).attr( 'aria-expanded', 'false' );
62
+
63
+ elmenuTogglePrimary.on( 'click.actions', function() {
64
+ $( this ).add( elementorPrimaryHeaderMenu ).toggleClass( 'eltoggled-on' );
65
+
66
+ // jscs:disable
67
+ $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorPrimaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
68
+ // jscs:enable
69
+ } );
70
+ } )();
71
+
72
+ // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
73
+ ( function() {
74
+ if ( ! elementorPrimaryNavigation.length || ! elementorPrimaryNavigation.children().length ) {
75
+ return;
76
+ }
77
+
78
+ // Toggle `focus` class to allow submenu access on tablets.
79
+ function toggleFocusClassTouchScreen() {
80
+ if ( window.innerWidth >= 910 ) {
81
+ $( document.body ).on( 'touchstart.actions', function( e ) {
82
+ if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
83
+ $( '.elementor-navigation li' ).removeClass( 'focus' );
84
+ }
85
+ } );
86
+ elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
87
+ var el = $( this ).parent( 'li' );
88
+
89
+ if ( ! el.hasClass( 'focus' ) ) {
90
+ e.preventDefault();
91
+ el.toggleClass( 'focus' );
92
+ el.siblings( '.focus' ).removeClass( 'focus' );
93
+ }
94
+ } );
95
+ } else {
96
+ elementorPrimaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
97
+ }
98
+ }
99
+
100
+ if ( 'ontouchstart' in window ) {
101
+ $( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
102
+ toggleFocusClassTouchScreen();
103
+ }
104
+
105
+ elementorPrimaryNavigation.find( 'a' ).on( 'focus.actions blur.actions', function() {
106
+ $( this ).parents( '.menu-item' ).toggleClass( 'focus' );
107
+ } );
108
+ } )();
109
+
110
+ // Add the default ARIA attributes for the menu toggle and the navigations.
111
+ function onResizeARIA() {
112
+ if ( window.innerWidth < 910 ) {
113
+ if ( elmenuTogglePrimary.hasClass( 'eltoggled-on' ) ) {
114
+ elmenuTogglePrimary.attr( 'aria-expanded', 'true' );
115
+ } else {
116
+ elmenuTogglePrimary.attr( 'aria-expanded', 'false' );
117
+ }
118
+
119
+ if ( elementorPrimaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
120
+ elementorPrimaryNavigation.attr( 'aria-expanded', 'true' );
121
+ } else {
122
+ elementorPrimaryNavigation.attr( 'aria-expanded', 'false' );
123
+ }
124
+
125
+ elmenuTogglePrimary.attr( 'aria-controls', 'site-navigation' );
126
+ } else {
127
+ elmenuTogglePrimary.removeAttr( 'aria-expanded' );
128
+ elementorPrimaryNavigation.removeAttr( 'aria-expanded' );
129
+ elmenuTogglePrimary.removeAttr( 'aria-controls' );
130
+ }
131
+ }
132
+ } )( jQuery );
133
+
134
+ // Start our Secondary navigation
135
+ ( function( $ ) {
136
+ var body, menuAreaSecondary, elmenuToggleSecondary, elementorSecondaryNavigation, elementorSecondaryHeaderMenu, resizeTimer;
137
+
138
+ function initElementorSecondaryNavigation( container ) {
139
+
140
+ // Add dropdown toggle that displays child menu items.
141
+ var eldropdownToggle = $( '<button />', {
142
+ 'class': 'eldropdown-toggle',
143
+ 'aria-expanded': false
144
+ } ).append( $( '<span />', {
145
+ 'class': 'screen-reader-text',
146
+ text: elementorScreenReaderText.expand
147
+ } ) );
148
+
149
+ container.find( '.menu-item-has-children > a' ).after( eldropdownToggle );
150
+
151
+ // Toggle buttons and submenu items with active children menu items.
152
+ container.find( '.current-menu-ancestor > button' ).addClass( 'eltoggled-on' );
153
+ container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'eltoggled-on' );
154
+
155
+ // Add menu items with submenus to aria-haspopup="true".
156
+ container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
157
+
158
+ container.find( '.eldropdown-toggle' ).click( function( e ) {
159
+ var _this = $( this ),
160
+ screenReaderSpan = _this.find( '.screen-reader-text' );
161
+
162
+ e.preventDefault();
163
+ _this.toggleClass( 'eltoggled-on' );
164
+ _this.next( '.children, .sub-menu' ).toggleClass( 'eltoggled-on' );
165
+
166
+ // jscs:disable
167
+ _this.attr( 'aria-expanded', _this.attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
168
+ // jscs:enable
169
+ screenReaderSpan.text( screenReaderSpan.text() === elementorScreenReaderText.expand ? elementorScreenReaderText.collapse : elementorScreenReaderText.expand );
170
+ } );
171
+ }
172
+ initElementorSecondaryNavigation( $( '.elementor-navigation' ) );
173
+
174
+ menuAreaSecondary = $( '#elementor-header-secondary' );
175
+ elmenuToggleSecondary = menuAreaSecondary.find( '#elementor-menu-toggle' );
176
+ elementorSecondaryHeaderMenu = menuAreaSecondary.find( '#elementor-menu' );
177
+ elementorSecondaryNavigation = menuAreaSecondary.find( '#elementor-navigation' );
178
+
179
+ // Enable elmenuToggleSecondary.
180
+ ( function() {
181
+
182
+ // Return early if elmenuToggleSecondary is missing.
183
+ if ( ! elmenuToggleSecondary.length ) {
184
+ return;
185
+ }
186
+
187
+ // Add an initial values for the attribute.
188
+ elmenuToggleSecondary.add( elementorSecondaryNavigation ).attr( 'aria-expanded', 'false' );
189
+
190
+ elmenuToggleSecondary.on( 'click.actions', function() {
191
+ $( this ).add( elementorSecondaryHeaderMenu ).toggleClass( 'eltoggled-on' );
192
+
193
+ // jscs:disable
194
+ $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded', $( this ).add( elementorSecondaryNavigation ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' );
195
+ // jscs:enable
196
+ } );
197
+ } )();
198
+
199
+ // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility.
200
+ ( function() {
201
+ if ( ! elementorSecondaryNavigation.length || ! elementorSecondaryNavigation.children().length ) {
202
+ return;
203
+ }
204
+
205
+ // Toggle `focus` class to allow submenu access on tablets.
206
+ function toggleFocusClassTouchScreen() {
207
+ if ( window.innerWidth >= 910 ) {
208
+ $( document.body ).on( 'touchstart.actions', function( e ) {
209
+ if ( ! $( e.target ).closest( '.elementor-navigation li' ).length ) {
210
+ $( '.elementor-navigation li' ).removeClass( 'focus' );
211
+ }
212
+ } );
213
+ elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).on( 'touchstart.actions', function( e ) {
214
+ var el = $( this ).parent( 'li' );
215
+
216
+ if ( ! el.hasClass( 'focus' ) ) {
217
+ e.preventDefault();
218
+ el.toggleClass( 'focus' );
219
+ el.siblings( '.focus' ).removeClass( 'focus' );
220
+ }
221
+ } );
222
+ } else {
223
+ elementorSecondaryNavigation.find( '.menu-item-has-children > a' ).unbind( 'touchstart.actions' );
224
+ }
225
+ }
226
+
227
+ if ( 'ontouchstart' in window ) {
228
+ $( window ).on( 'resize.actions', toggleFocusClassTouchScreen );
229
+ toggleFocusClassTouchScreen();
230
+ }
231
+
232
+ elementorSecondaryNavigation.find( 'a' ).on( 'focus.actions blur.actions', function() {
233
+ $( this ).parents( '.menu-item' ).toggleClass( 'focus' );
234
+ } );
235
+ } )();
236
+
237
+ // Add the default ARIA attributes for the menu toggle and the navigations.
238
+ function onResizeARIA() {
239
+ if ( window.innerWidth < 910 ) {
240
+ if ( elmenuToggleSecondary.hasClass( 'eltoggled-on' ) ) {
241
+ elmenuToggleSecondary.attr( 'aria-expanded', 'true' );
242
+ } else {
243
+ elmenuToggleSecondary.attr( 'aria-expanded', 'false' );
244
+ }
245
+
246
+ if ( elementorSecondaryHeaderMenu.hasClass( 'eltoggled-on' ) ) {
247
+ elementorSecondaryNavigation.attr( 'aria-expanded', 'true' );
248
+ } else {
249
+ elementorSecondaryNavigation.attr( 'aria-expanded', 'false' );
250
+ }
251
+
252
+ elmenuToggleSecondary.attr( 'aria-controls', 'site-navigation' );
253
+ } else {
254
+ elmenuToggleSecondary.removeAttr( 'aria-expanded' );
255
+ elementorSecondaryNavigation.removeAttr( 'aria-expanded' );
256
+ elmenuToggleSecondary.removeAttr( 'aria-controls' );
257
+ }
258
+ }
259
+ } )( jQuery );
base/module-base.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus\Base;
3
+
4
+ abstract class Module_Base {
5
+
6
+ /**
7
+ * @var \ReflectionClass
8
+ */
9
+ private $reflection;
10
+
11
+ private $components = [];
12
+
13
+ /**
14
+ * @var Module_Base
15
+ */
16
+ protected static $_instances = [];
17
+
18
+ /**
19
+ * Throw error on object clone
20
+ *
21
+ * The whole idea of the singleton design pattern is that there is a single
22
+ * object therefore, we don't want the object to be cloned.
23
+ *
24
+ * @since 1.0.0
25
+ * @return void
26
+ */
27
+ public function __clone() {
28
+ // Cloning instances of the class is forbidden
29
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor-menus' ), '1.0.0' );
30
+ }
31
+
32
+ /**
33
+ * Disable unserializing of the class
34
+ *
35
+ * @since 1.0.0
36
+ * @return void
37
+ */
38
+ public function __wakeup() {
39
+ // Unserializing instances of the class is forbidden
40
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor-menus' ), '1.0.0' );
41
+ }
42
+
43
+ public static function class_name() {
44
+ return get_called_class();
45
+ }
46
+
47
+ /**
48
+ * @return Module_Base
49
+ */
50
+ public static function instance() {
51
+ if ( empty( static::$_instances[ static::class_name() ] ) ) {
52
+ static::$_instances[ static::class_name() ] = new static();
53
+ }
54
+
55
+ return static::$_instances[ static::class_name() ];
56
+ }
57
+
58
+ abstract public function get_name();
59
+
60
+ public function get_assets_url() {
61
+ return elementor_menus_MODULES_URL . $this->get_name() . '/assets/';
62
+ }
63
+
64
+ public function get_widgets() {
65
+ return [];
66
+ }
67
+
68
+ public function __construct() {
69
+ $this->reflection = new \ReflectionClass( $this );
70
+
71
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'init_widgets' ] );
72
+ }
73
+
74
+ public function init_widgets() {
75
+ $widget_manager = \Elementor\Plugin::instance()->widgets_manager;
76
+
77
+ foreach ( $this->get_widgets() as $widget ) {
78
+ $class_name = $this->reflection->getNamespaceName() . '\Widgets\\' . $widget;
79
+ $widget_manager->register_widget_type( new $class_name() );
80
+ }
81
+ }
82
+
83
+ public function add_component( $id, $instance ) {
84
+ $this->components[ $id ] = $instance;
85
+ }
86
+
87
+ public function get_component( $id ) {
88
+ if ( isset( $this->components[ $id ] ) ) {
89
+ return $this->components[ $id ];
90
+ }
91
+
92
+ return false;
93
+ }
94
+ }
classes/utils.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus\Classes;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class Utils {
7
+
8
+ public static function get_client_ip() {
9
+ $server_ip_keys = [
10
+ 'HTTP_CLIENT_IP',
11
+ 'HTTP_X_FORWARDED_FOR',
12
+ 'HTTP_X_FORWARDED',
13
+ 'HTTP_X_CLUSTER_CLIENT_IP',
14
+ 'HTTP_FORWARDED_FOR',
15
+ 'HTTP_FORWARDED',
16
+ 'REMOTE_ADDR',
17
+ ];
18
+
19
+ foreach ( $server_ip_keys as $key ) {
20
+ if ( isset( $_SERVER[ $key ] ) && filter_var( $_SERVER[ $key ], FILTER_VALIDATE_IP ) ) {
21
+ return $_SERVER[ $key ];
22
+ }
23
+ }
24
+
25
+ // Fallback local ip.
26
+ return '127.0.0.1';
27
+ }
28
+
29
+ public static function get_site_domain() {
30
+ return str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );
31
+ }
32
+ }
elementor-navmenu.php CHANGED
@@ -1,46 +1,115 @@
1
  <?php
2
  /**
3
  * Plugin Name: NavMenu Addon For Elementor
4
- * Description: A custom navbar addon for the Elementor Page Builder plugin - any theme and template.
5
- * Plugin URI: https://wpdevhq.com/
6
- * Version: 1.0.0
7
- * Author: WPDevHQ
8
- * Author URI: https://wpdevhq.com/plugins/navmenu-addon-elementor
9
- * Text Domain: elementor-navmenu
10
- */
 
11
 
12
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
- * Load Elementor Navbar
16
- *
17
- * Load the plugin after Elementor (and other plugins) are loaded.
18
  *
19
  * @since 1.0.0
 
 
20
  */
21
- function elementor_navmenu_load() {
22
- // Load localization file
23
- load_plugin_textdomain( 'elementor-navmenu' );
24
 
25
- // Notice if the Elementor is not active
26
  if ( ! did_action( 'elementor/loaded' ) ) {
27
- add_action( 'admin_notices', 'elementor_navmenu_fail_load' );
28
  return;
29
  }
30
 
31
- // Check version required
32
- $elementor_version_required = '1.0.0';
33
  if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
34
- add_action( 'admin_notices', 'elementor_navmenu_fail_load_out_of_date' );
35
  return;
36
  }
37
 
38
- // Require the main plugin file
39
- require( __DIR__ . '/plugin.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
- add_action( 'plugins_loaded', 'elementor_navmenu_load' );
42
 
43
- function ele_navbar_menu_choices() {
44
  $menus = wp_get_nav_menus();
45
  $items = array();
46
  $i = 0;
1
  <?php
2
  /**
3
  * Plugin Name: NavMenu Addon For Elementor
4
+ * Description: Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options
5
+ * Plugin URI: https://wpdevhq.com/
6
+ * Author: WPDevHQ
7
+ * Version: 1.0.1
8
+ * Author URI: https://wpdevhq.com/
9
+ *
10
+ * Text Domain: elementor-menus
11
+ */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
+ define( 'ELEMENTOR_MENUS_VERSION', '1.0.1' );
16
+
17
+ define( 'ELEMENTOR_MENUS__FILE__', __FILE__ );
18
+ define( 'ELEMENTOR_MENUS_PLUGIN_BASE', plugin_basename( ELEMENTOR_MENUS__FILE__ ) );
19
+ define( 'ELEMENTOR_MENUS_PATH', plugin_dir_path( ELEMENTOR_MENUS__FILE__ ) );
20
+ define( 'ELEMENTOR_MENUS_MODULES_PATH', ELEMENTOR_MENUS_PATH . 'modules/' );
21
+ define( 'ELEMENTOR_MENUS_URL', plugins_url( '/', ELEMENTOR_MENUS__FILE__ ) );
22
+ define( 'ELEMENTOR_MENUS_ASSETS_URL', ELEMENTOR_MENUS_URL . 'assets/' );
23
+ define( 'ELEMENTOR_MENUS_MODULES_URL', ELEMENTOR_MENUS_URL . 'modules/' );
24
+
25
  /**
26
+ * Load gettext translate for our text domain.
 
 
27
  *
28
  * @since 1.0.0
29
+ *
30
+ * @return void
31
  */
32
+ function elementor_menus_load_plugin() {
33
+ load_plugin_textdomain( 'elementor-menus' );
 
34
 
 
35
  if ( ! did_action( 'elementor/loaded' ) ) {
36
+ add_action( 'admin_notices', 'elementor_menus_fail_load' );
37
  return;
38
  }
39
 
40
+ $elementor_version_required = '1.0.6';
 
41
  if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
42
+ add_action( 'admin_notices', 'elementor_menus_fail_load_out_of_date' );
43
  return;
44
  }
45
 
46
+ require( ELEMENTOR_MENUS_PATH . 'plugin.php' );
47
+ }
48
+ add_action( 'plugins_loaded', 'elementor_menus_load_plugin' );
49
+
50
+ /**
51
+ * Show in WP Dashboard notice about the plugin is not activated.
52
+ *
53
+ * @since 1.0.0
54
+ *
55
+ * @return void
56
+ */
57
+ function elementor_menus_fail_load() {
58
+ $screen = get_current_screen();
59
+ if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
60
+ return;
61
+ }
62
+
63
+ $plugin = 'elementor/elementor.php';
64
+
65
+ if ( _is_elementor_installed() ) {
66
+ if ( ! current_user_can( 'activate_plugins' ) ) {
67
+ return;
68
+ }
69
+
70
+ $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
71
+
72
+ $message = '<p>' . __( 'Elementor WooStore is not working because you need to activate the Elementor plugin.', 'elementor-menus' ) . '</p>';
73
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Elementor Now', 'elementor-menus' ) ) . '</p>';
74
+ } else {
75
+ if ( ! current_user_can( 'install_plugins' ) ) {
76
+ return;
77
+ }
78
+
79
+ $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
80
+
81
+ $message = '<p>' . __( 'Elementor WooStore is not working because you need to install the Elemenor plugin', 'elementor-menus' ) . '</p>';
82
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, __( 'Install Elementor Now', 'elementor-menus' ) ) . '</p>';
83
+ }
84
+
85
+ echo '<div class="error"><p>' . $message . '</p></div>';
86
+ }
87
+
88
+ function elementor_menus_fail_load_out_of_date() {
89
+ if ( ! current_user_can( 'update_plugins' ) ) {
90
+ return;
91
+ }
92
+
93
+ $file_path = 'elementor/elementor.php';
94
+
95
+ $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
96
+ $message = '<p>' . __( 'Elementor WooStore is not working because you are using an old version of Elementor.', 'elementor-menus' ) . '</p>';
97
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $upgrade_link, __( 'Update Elementor Now', 'elementor-menus' ) ) . '</p>';
98
+
99
+ echo '<div class="error">' . $message . '</div>';
100
+ }
101
+
102
+ if ( ! function_exists( '_is_elementor_installed' ) ) {
103
+
104
+ function _is_elementor_installed() {
105
+ $file_path = 'elementor/elementor.php';
106
+ $installed_plugins = get_plugins();
107
+
108
+ return isset( $installed_plugins[ $file_path ] );
109
+ }
110
  }
 
111
 
112
+ function menus_navbar_menu_choices() {
113
  $menus = wp_get_nav_menus();
114
  $items = array();
115
  $i = 0;
includes/modules-manager.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ final class Manager {
7
+
8
+ private $_modules = null;
9
+
10
+ private function is_module_active( $module_id ) {
11
+ $module_data = $this->get_module_data( $module_id );
12
+ if ( $module_data['required'] ) {
13
+ return true;
14
+ }
15
+
16
+ $options = get_option( 'elementor_menus_active_modules', [] );
17
+ if ( ! isset( $options[ $module_id ] ) ) {
18
+ return $module_data['default_activation'];
19
+ }
20
+
21
+ return 'true' === $options[ $module_id ];
22
+ }
23
+
24
+ private function get_module_data( $module_id ) {
25
+ return isset( $this->_modules[ $module_id ] ) ? $this->_modules[ $module_id ] : false;
26
+ }
27
+
28
+ public function __construct() {
29
+ $modules = [
30
+ 'menus',
31
+ ];
32
+
33
+ // Fetch all modules data
34
+ foreach ( $modules as $module ) {
35
+ $this->_modules[ $module ] = require ELEMENTOR_MENUS_MODULES_PATH . $module . '/module.info.php';
36
+ }
37
+
38
+ foreach ( $this->_modules as $module_id => $module_data ) {
39
+ if ( ! $this->is_module_active( $module_id ) ) {
40
+ continue;
41
+ }
42
+
43
+ $class_name = str_replace( '-', ' ', $module_id );
44
+ $class_name = str_replace( ' ', '', ucwords( $class_name ) );
45
+ $class_name = __NAMESPACE__ . '\\Modules\\' . $class_name . '\Module';
46
+
47
+ $class_name::instance();
48
+ }
49
+ }
50
+ }
modules/menus/module.info.php ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
+
4
+ return [
5
+ 'title' => __( 'Menus', 'elementor-menus' ),
6
+ 'required' => true,
7
+ 'default_activation' => true,
8
+ ];
modules/menus/module.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus\Modules\Menus;
3
+
4
+ use Elementor\Plugin;
5
+ use ElementorMenus\Base\Module_Base;
6
+
7
+ class Module extends Module_Base {
8
+
9
+ public function __construct() {
10
+ parent::__construct();
11
+
12
+ //$this->add_actions();
13
+ }
14
+
15
+ public function get_name() {
16
+ return 'elementor-menus';
17
+ }
18
+
19
+ public function get_widgets() {
20
+ return [
21
+ 'Elementor_Branding',
22
+ 'Default_Navmenu',
23
+ ];
24
+ }
25
+
26
+ }
widgets/elementor-navmenu.php → modules/menus/widgets/default-navmenu.php RENAMED
@@ -1,5 +1,5 @@
1
  <?php
2
- namespace ElementorNavmenu\Widgets;
3
 
4
  use Elementor\Widget_Base;
5
  use Elementor\Controls_Manager;
@@ -17,14 +17,14 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
  *
18
  * @since 1.0.0
19
  */
20
- class Elementor_Navmenu extends Widget_Base {
21
 
22
  public function get_name() {
23
- return 'elementor-navmenu';
24
  }
25
 
26
  public function get_title() {
27
- return __( 'Elementor Navmenu', 'elementor-navmenu' );
28
  }
29
 
30
  public function get_icon() {
@@ -32,7 +32,7 @@ class Elementor_Navmenu extends Widget_Base {
32
  }
33
 
34
  public function get_categories() {
35
- return [ 'general-elements' ];
36
  }
37
 
38
  protected function _register_controls() {
@@ -50,11 +50,25 @@ class Elementor_Navmenu extends Widget_Base {
50
  [
51
  'label' => __( 'Select Menu', 'elementor-navmenu' ),
52
  'type' => Controls_Manager::SELECT,
53
- 'options' => ele_navbar_menu_choices(),
54
  'default' => '',
55
  ]
56
  );
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  $this->add_responsive_control(
59
  'align',
60
  [
@@ -114,6 +128,7 @@ class Elementor_Navmenu extends Widget_Base {
114
  'type' => Scheme_Color::get_type(),
115
  'value' => Scheme_Color::COLOR_1,
116
  ],
 
117
  'selectors' => [
118
  '{{WRAPPER}} .elementor-nav-menu .menu-item a' => 'background-color: {{VALUE}};',
119
  ],
@@ -377,6 +392,7 @@ class Elementor_Navmenu extends Widget_Base {
377
  protected function render() {
378
 
379
  $settings = $this->get_settings();
 
380
  // Get menu
381
  $nav_menu = ! empty( $settings['el_nav_menu'] ) ? wp_get_nav_menu_object( $settings['el_nav_menu'] ) : false;
382
 
@@ -393,9 +409,9 @@ class Elementor_Navmenu extends Widget_Base {
393
  'depth' => 0,
394
  'walker' => '',
395
  );
396
- ?>
397
- <div id="elementor-header" class="elementor-header">
398
-
399
  <button id="elementor-menu-toggle" class="elementor-menu-toggle"><i class="fa fa-navicon"></i></button>
400
  <div id="elementor-menu" class="elementor-menu">
401
 
1
  <?php
2
+ namespace ElementorMenus\Modules\Menus\Widgets;
3
 
4
  use Elementor\Widget_Base;
5
  use Elementor\Controls_Manager;
17
  *
18
  * @since 1.0.0
19
  */
20
+ class Default_Navmenu extends Widget_Base {
21
 
22
  public function get_name() {
23
+ return 'default-navmenu';
24
  }
25
 
26
  public function get_title() {
27
+ return __( 'Default Navmenu', 'elementor-navmenu' );
28
  }
29
 
30
  public function get_icon() {
32
  }
33
 
34
  public function get_categories() {
35
+ return [ 'branding-elements' ];
36
  }
37
 
38
  protected function _register_controls() {
50
  [
51
  'label' => __( 'Select Menu', 'elementor-navmenu' ),
52
  'type' => Controls_Manager::SELECT,
53
+ 'options' => menus_navbar_menu_choices(),
54
  'default' => '',
55
  ]
56
  );
57
 
58
+ $this->add_control(
59
+ 'el_menu_location',
60
+ [
61
+ 'label' => __( 'Menu Location', 'elementor-navmenu' ),
62
+ 'description' => __( 'Select a location for your menu. This option facilitate the ability to create up to 2 mobile enabled menu locations', 'elementor-navmenu' ),
63
+ 'type' => Controls_Manager::SELECT,
64
+ 'options' => [
65
+ 'primary' => __( 'Primary', 'elementor' ),
66
+ 'secondary' => __( 'Secondary', 'elementor' ),
67
+ ],
68
+ 'default' => 'primary',
69
+ ]
70
+ );
71
+
72
  $this->add_responsive_control(
73
  'align',
74
  [
128
  'type' => Scheme_Color::get_type(),
129
  'value' => Scheme_Color::COLOR_1,
130
  ],
131
+ 'default' => '#00215e',
132
  'selectors' => [
133
  '{{WRAPPER}} .elementor-nav-menu .menu-item a' => 'background-color: {{VALUE}};',
134
  ],
392
  protected function render() {
393
 
394
  $settings = $this->get_settings();
395
+ $menu_location = $settings['el_menu_location'];
396
  // Get menu
397
  $nav_menu = ! empty( $settings['el_nav_menu'] ) ? wp_get_nav_menu_object( $settings['el_nav_menu'] ) : false;
398
 
409
  'depth' => 0,
410
  'walker' => '',
411
  );
412
+
413
+ echo '<div id="elementor-header-' . $menu_location . '" class="elementor-header">';
414
+ ?>
415
  <button id="elementor-menu-toggle" class="elementor-menu-toggle"><i class="fa fa-navicon"></i></button>
416
  <div id="elementor-menu" class="elementor-menu">
417
 
modules/menus/widgets/elementor-branding.php ADDED
@@ -0,0 +1,323 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus\Modules\Menus\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Group_Control_Border;
7
+ use Elementor\Group_Control_Typography;
8
+ use Elementor\Scheme_Color;
9
+ use Elementor\Scheme_Typography;
10
+
11
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
+
13
+ /**
14
+ * Elementor Elementor Navbar
15
+ *
16
+ * Elementor widget for hello world.
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ class Elementor_Branding extends Widget_Base {
21
+
22
+ public function get_name() {
23
+ return 'elementor-branding';
24
+ }
25
+
26
+ public function get_title() {
27
+ return __( 'Branding', 'elementor-navmenu' );
28
+ }
29
+
30
+ public function get_icon() {
31
+ return 'eicon-banner';
32
+ }
33
+
34
+ public function get_categories() {
35
+ return [ 'branding-elements' ];
36
+ }
37
+
38
+ protected function _register_controls() {
39
+ //$menus = $this->get_menus();
40
+
41
+ $this->start_controls_section(
42
+ 'section_content',
43
+ [
44
+ 'label' => __( 'Branding', 'elementor-navmenu' ),
45
+ ]
46
+ );
47
+
48
+ $this->add_control(
49
+ 'el_site_branding',
50
+ [
51
+ 'label' => __( 'Branding Type', 'elementor-navmenu' ),
52
+ 'description' => __( 'Your theme must declare the "add_theme_support( \'custom-logo\')" for the logo to work', 'elementor-navmenu' ),
53
+ 'type' => Controls_Manager::SELECT,
54
+ 'options' => [
55
+ 'title' => __( 'Title', 'elementor' ),
56
+ 'logo' => __( 'Logo', 'elementor' ),
57
+ ],
58
+ 'default' => 'title',
59
+ ]
60
+ );
61
+
62
+ $this->add_responsive_control(
63
+ 'align',
64
+ [
65
+ 'label' => __( 'Alignment', 'elementor-navmenu' ),
66
+ 'type' => Controls_Manager::CHOOSE,
67
+ 'options' => [
68
+ 'left' => [
69
+ 'title' => __( 'Left', 'elementor-navmenu' ),
70
+ 'icon' => 'fa fa-align-left',
71
+ ],
72
+ 'center' => [
73
+ 'title' => __( 'Center', 'elementor-navmenu' ),
74
+ 'icon' => 'fa fa-align-center',
75
+ ],
76
+ 'right' => [
77
+ 'title' => __( 'Right', 'elementor-navmenu' ),
78
+ 'icon' => 'fa fa-align-right',
79
+ ],
80
+ ],
81
+ 'prefix_class' => 'elementor%s-align-',
82
+ 'default' => '',
83
+ ]
84
+ );
85
+
86
+ $this->end_controls_section();
87
+
88
+ $this->start_controls_section(
89
+ 'section_title_style',
90
+ [
91
+ 'label' => __( 'Brand', 'elementor-navmenu' ),
92
+ 'tab' => Controls_Manager::TAB_STYLE,
93
+ ]
94
+ );
95
+
96
+ $this->add_control(
97
+ 'branding_title_color',
98
+ [
99
+ 'label' => __( 'Title Color', 'elementor-navmenu' ),
100
+ 'type' => Controls_Manager::COLOR,
101
+ 'condition' => [
102
+ 'el_site_branding' => 'title',
103
+ ],
104
+ 'scheme' => [
105
+ 'type' => Scheme_Color::get_type(),
106
+ 'value' => Scheme_Color::COLOR_1,
107
+ ],
108
+ 'default' => '#333333',
109
+ 'selectors' => [
110
+ '{{WRAPPER}} .elementor-branding .site-title a' => 'color: {{VALUE}};',
111
+ ],
112
+ ]
113
+ );
114
+
115
+ $this->add_control(
116
+ 'branding_title_hover',
117
+ [
118
+ 'label' => __( 'Hover', 'elementor-navmenu' ),
119
+ 'type' => Controls_Manager::COLOR,
120
+ 'condition' => [
121
+ 'el_site_branding' => 'title',
122
+ ],
123
+ 'scheme' => [
124
+ 'type' => Scheme_Color::get_type(),
125
+ 'value' => Scheme_Color::COLOR_1,
126
+ ],
127
+ 'selectors' => [
128
+ '{{WRAPPER}} .elementor-branding .site-title a:hover' => 'color: {{VALUE}};',
129
+ ],
130
+ ]
131
+ );
132
+
133
+ $this->add_control(
134
+ 'title_padding',
135
+ [
136
+ 'label' => __( 'Title Padding - Default 1em', 'elementor-navmenu' ),
137
+ 'type' => Controls_Manager::DIMENSIONS,
138
+ 'condition' => [
139
+ 'el_site_branding' => 'title',
140
+ ],
141
+ 'size_units' => [ 'px', 'em', '%' ],
142
+ 'selectors' => [
143
+ '{{WRAPPER}} .elementor-branding .site-title a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
144
+ ],
145
+ ]
146
+ );
147
+
148
+ $this->add_group_control(
149
+ Group_Control_Typography::get_type(),
150
+ [
151
+ 'name' => 'title_typography',
152
+ 'label' => __( 'Typography', 'elementor-navmenu' ),
153
+ 'condition' => [
154
+ 'el_site_branding' => 'title',
155
+ ],
156
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
157
+ 'selector' => '{{WRAPPER}} .elementor-branding .site-title',
158
+ ]
159
+ );
160
+
161
+ $this->add_control(
162
+ 'logo_padding',
163
+ [
164
+ 'label' => __( 'Title Padding - Default 1em', 'elementor-navmenu' ),
165
+ 'type' => Controls_Manager::DIMENSIONS,
166
+ 'condition' => [
167
+ 'el_site_branding' => 'logo',
168
+ ],
169
+ 'size_units' => [ 'px', 'em', '%' ],
170
+ 'selectors' => [
171
+ '{{WRAPPER}} .elementor-branding .custom-logo' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
172
+ ],
173
+ ]
174
+ );
175
+
176
+ $this->end_controls_section();
177
+
178
+ $this->start_controls_section(
179
+ 'section_desc_style',
180
+ [
181
+ 'label' => __( 'Description Options', 'elementor-navmenu' ),
182
+ 'tab' => Controls_Manager::TAB_STYLE,
183
+ 'condition' => [
184
+ 'el_site_branding' => 'title',
185
+ ],
186
+ ]
187
+ );
188
+
189
+ $this->add_control(
190
+ 'branding_description_color',
191
+ [
192
+ 'label' => __( 'Description Color', 'elementor-navmenu' ),
193
+ 'type' => Controls_Manager::COLOR,
194
+ 'condition' => [
195
+ 'el_site_branding' => 'title',
196
+ ],
197
+ 'scheme' => [
198
+ 'type' => Scheme_Color::get_type(),
199
+ 'value' => Scheme_Color::COLOR_1,
200
+ ],
201
+ 'selectors' => [
202
+ '{{WRAPPER}} .elementor-branding .site-description' => 'color: {{VALUE}};',
203
+ ],
204
+ ]
205
+ );
206
+
207
+ $this->add_control(
208
+ 'desc_padding',
209
+ [
210
+ 'label' => __( 'Description Padding - Default 1em', 'elementor-navmenu' ),
211
+ 'type' => Controls_Manager::DIMENSIONS,
212
+ 'condition' => [
213
+ 'el_site_branding' => 'title',
214
+ ],
215
+ 'size_units' => [ 'px', 'em', '%' ],
216
+ 'selectors' => [
217
+ '{{WRAPPER}} .elementor-branding .site-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
218
+ ],
219
+ ]
220
+ );
221
+
222
+ $this->add_group_control(
223
+ Group_Control_Typography::get_type(),
224
+ [
225
+ 'name' => 'desc_typography',
226
+ 'label' => __( 'Typography', 'elementor-navmenu' ),
227
+ 'condition' => [
228
+ 'el_site_branding' => 'title',
229
+ ],
230
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
231
+ 'selector' => '{{WRAPPER}} .elementor-branding .site-description',
232
+ ]
233
+ );
234
+
235
+ $this->end_controls_section();
236
+
237
+
238
+ $this->start_controls_section(
239
+ 'section_branding_borders',
240
+ [
241
+ 'label' => __( 'Branding Border', 'elementor-navmenu' ),
242
+ 'tab' => Controls_Manager::TAB_STYLE,
243
+ ]
244
+ );
245
+
246
+ $this->add_group_control(
247
+ Group_Control_Border::get_type(),
248
+ [
249
+ 'name' => 'border',
250
+ 'label' => __( 'Border', 'elementor-navmenu' ),
251
+ 'default' => '1px',
252
+ 'selector' => '{{WRAPPER}} .elementor-branding',
253
+ ]
254
+ );
255
+
256
+ $this->add_control(
257
+ 'border_radius',
258
+ [
259
+ 'label' => __( 'Border Radius', 'elementor-navmenu' ),
260
+ 'type' => Controls_Manager::DIMENSIONS,
261
+ 'size_units' => [ 'px', '%' ],
262
+ 'selectors' => [
263
+ '{{WRAPPER}} .elementor-branding' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
264
+ ],
265
+ ]
266
+ );
267
+
268
+ $this->end_controls_section();
269
+
270
+ }
271
+
272
+ protected function branding_output() {
273
+ $settings = $this->get_settings();
274
+
275
+ if ( $settings['el_site_branding'] == 'title' ) {
276
+ $this->render_title();
277
+ } elseif ( $settings['el_site_branding'] == 'logo' ) {
278
+ $this->render_logo();
279
+ }
280
+ }
281
+
282
+ protected function elementor_the_site_logo() {
283
+ if ( function_exists( 'the_custom_logo' ) ) {
284
+ the_custom_logo();
285
+ }
286
+ }
287
+
288
+ protected function render_title() { ?>
289
+ <span class="site-title">
290
+ <?php
291
+ $title = get_bloginfo('name');
292
+ ?>
293
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( $title ); /* WPCS: xss ok. */ ?>" alt="<?php echo esc_attr( $title ); ?>">
294
+ <?php bloginfo( 'name' ); ?>
295
+ </a>
296
+ </span>
297
+ <?php
298
+ $description = get_bloginfo( 'description', 'display' );
299
+ if ( $description || is_customize_preview() ) : ?>
300
+ <p class="site-description"><?php echo $description; /* WPCS: xss ok. */ ?></p>
301
+ <?php endif;
302
+ }
303
+
304
+ protected function render_logo() {
305
+ $this->elementor_the_site_logo();
306
+ }
307
+
308
+ protected function render() {
309
+
310
+ $settings = $this->get_settings(); ?>
311
+
312
+ <div id="elementor-branding" class="elementor-branding">
313
+ <div class="header-title">
314
+ <?php
315
+ $this->branding_output();
316
+ ?>
317
+ </div>
318
+ </div>
319
+ <?php
320
+ }
321
+
322
+ protected function _content_template() {}
323
+ }
plugin.php CHANGED
@@ -1,95 +1,263 @@
1
- <?php
2
- namespace ElementorNavmenu;
3
-
4
- use ElementorNavmenu\Widgets\Elementor_Navmenu;
5
-
6
- if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
-
8
- /**
9
- * Main Plugin Class
10
- *
11
- * Register new elementor widget.
12
- *
13
- * @since 1.0.0
14
- */
15
- class Plugin {
16
-
17
- /**
18
- * Constructor
19
- *
20
- * @since 1.0.0
21
- *
22
- * @access public
23
- */
24
- public function __construct() {
25
- $this->add_actions();
26
-
27
- add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_default_scripts' ), 998 );
28
- add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_default_scripts' ], 997 );
29
- }
30
-
31
- /**
32
- * Add Actions
33
- *
34
- * @since 1.0.0
35
- *
36
- * @access private
37
- */
38
- private function add_actions() {
39
- add_action( 'elementor/widgets/widgets_registered', [ $this, 'on_widgets_registered' ] );
40
- }
41
-
42
- /**
43
- * On Widgets Registered
44
- *
45
- * @since 1.0.0
46
- *
47
- * @access public
48
- */
49
- public function on_widgets_registered() {
50
- $this->includes();
51
- $this->register_widget();
52
- }
53
-
54
- /**
55
- * Enqueue Custom CSS - theme agnostic.
56
- * @since 1.0.0
57
- * @return void
58
- */
59
- public function enqueue_default_scripts() {
60
- wp_register_style( 'elementor-default', plugins_url( 'assets/css/default.css', __FILE__ ) );
61
- wp_enqueue_style( 'elementor-default' );
62
-
63
- wp_register_script( 'elementor-default-js', plugins_url( 'assets/js/default.js', __FILE__ ), array( 'jquery' ), '4.7', true );
64
- wp_enqueue_script( 'elementor-default-js' );
65
-
66
- wp_localize_script( 'elementor-default-js', 'elementorScreenReaderText', array(
67
- 'expand' => __( 'expand child menu', 'elementor-default' ),
68
- 'collapse' => __( 'collapse child menu', 'elementor-default' ),
69
- ) );
70
- }
71
-
72
- /**
73
- * Includes
74
- *
75
- * @since 1.0.0
76
- *
77
- * @access private
78
- */
79
- private function includes() {
80
- require __DIR__ . '/widgets/elementor-navmenu.php';
81
- }
82
-
83
- /**
84
- * Register Widget
85
- *
86
- * @since 1.0.0
87
- *
88
- * @access private
89
- */
90
- private function register_widget() {
91
- \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor_Navmenu() );
92
- }
93
- }
94
-
95
- new Plugin();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace ElementorMenus;
3
+
4
+ use Elementor\Utils;
5
+ use Elementor\Controls_Manager;
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
8
+
9
+ /**
10
+ * Main class plugin
11
+ */
12
+ class Plugin {
13
+
14
+ /**
15
+ * @var Plugin
16
+ */
17
+ private static $_instance;
18
+
19
+ /**
20
+ * @var Manager
21
+ */
22
+ private $_modules_manager;
23
+
24
+ /**
25
+ * @var array
26
+ */
27
+ private $_localize_settings = [];
28
+
29
+ /**
30
+ * @return string
31
+ */
32
+ public function get_version() {
33
+ return ELEMENTOR_MENUS_VERSION;
34
+ }
35
+
36
+ /**
37
+ * Throw error on object clone
38
+ *
39
+ * The whole idea of the singleton design pattern is that there is a single
40
+ * object therefore, we don't want the object to be cloned.
41
+ *
42
+ * @since 1.0.0
43
+ * @return void
44
+ */
45
+ public function __clone() {
46
+ // Cloning instances of the class is forbidden
47
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor-menus' ), '1.0.0' );
48
+ }
49
+
50
+ /**
51
+ * Disable unserializing of the class
52
+ *
53
+ * @since 1.0.0
54
+ * @return void
55
+ */
56
+ public function __wakeup() {
57
+ // Unserializing instances of the class is forbidden
58
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor-menus' ), '1.0.0' );
59
+ }
60
+
61
+ /**
62
+ * @return Plugin
63
+ */
64
+ public static function instance() {
65
+ if ( is_null( self::$_instance ) ) {
66
+ self::$_instance = new self();
67
+ }
68
+
69
+ return self::$_instance;
70
+ }
71
+
72
+ private function _includes() {
73
+ require ELEMENTOR_MENUS_PATH . 'includes/modules-manager.php';
74
+
75
+ //if ( is_admin() ) {
76
+ //require ELEMENTOR_MENUS_PATH . 'includes/admin.php';
77
+ //}
78
+ }
79
+
80
+ public function autoload( $class ) {
81
+ if ( 0 !== strpos( $class, __NAMESPACE__ ) ) {
82
+ return;
83
+ }
84
+
85
+ $filename = strtolower(
86
+ preg_replace(
87
+ [ '/^' . __NAMESPACE__ . '\\\/', '/([a-z])([A-Z])/', '/_/', '/\\\/' ],
88
+ [ '', '$1-$2', '-', DIRECTORY_SEPARATOR ],
89
+ $class
90
+ )
91
+ );
92
+ $filename = ELEMENTOR_MENUS_PATH . $filename . '.php';
93
+
94
+ if ( is_readable( $filename ) ) {
95
+ include( $filename );
96
+ }
97
+ }
98
+
99
+ public function get_localize_settings() {
100
+ return $this->_localize_settings;
101
+ }
102
+
103
+ public function add_localize_settings( $setting_key, $setting_value = null ) {
104
+ if ( is_array( $setting_key ) ) {
105
+ $this->_localize_settings = array_replace_recursive( $this->_localize_settings, $setting_key );
106
+
107
+ return;
108
+ }
109
+
110
+ if ( ! is_array( $setting_value ) || ! isset( $this->_localize_settings[ $setting_key ] ) || ! is_array( $this->_localize_settings[ $setting_key ] ) ) {
111
+ $this->_localize_settings[ $setting_key ] = $setting_value;
112
+
113
+ return;
114
+ }
115
+
116
+ $this->_localize_settings[ $setting_key ] = array_replace_recursive( $this->_localize_settings[ $setting_key ], $setting_value );
117
+ }
118
+
119
+ public function enqueue_styles() {
120
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
121
+
122
+ $direction_suffix = is_rtl() ? '-rtl' : '';
123
+
124
+ wp_enqueue_style(
125
+ 'elementor-menus',
126
+ ELEMENTOR_MENUS_URL . 'assets/css/frontend' . $direction_suffix . $suffix . '.css',
127
+ [],
128
+ //Plugin::instance()->get_version()
129
+ ELEMENTOR_MENUS_VERSION
130
+ );
131
+
132
+ if ( is_admin() ) {
133
+ wp_enqueue_style(
134
+ 'elementor-menus-admin',
135
+ ELEMENTOR_MENUS_URL . 'assets/css/admin' . $direction_suffix . $suffix . '.css',
136
+ [],
137
+ //Plugin::instance()->get_version()
138
+ ELEMENTOR_MENUS_VERSION
139
+ );
140
+ }
141
+ }
142
+
143
+ public function enqueue_scripts() {
144
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
145
+
146
+ wp_enqueue_script(
147
+ 'elementor-menus-frontend',
148
+ ELEMENTOR_MENUS_URL . 'assets/js/frontend' . $suffix . '.js',
149
+ [
150
+ 'jquery',
151
+ ],
152
+ ELEMENTOR_MENUS_VERSION,
153
+ true
154
+ );
155
+
156
+ wp_localize_script(
157
+ 'elementor-menus-frontend',
158
+ 'ElementorMenusFrontendConfig',
159
+ [
160
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
161
+ 'nonce' => wp_create_nonce( 'elementor-menus-frontend' ),
162
+ ]
163
+ );
164
+ }
165
+
166
+ public function enqueue_panel_scripts() {
167
+ $suffix = Utils::is_script_debug() ? '' : '.min';
168
+
169
+ wp_enqueue_script(
170
+ 'elementor-menus',
171
+ ELEMENTOR_MENUS_URL . 'assets/js/editor' . $suffix . '.js',
172
+ [
173
+ 'backbone-marionette',
174
+ ],
175
+ ELEMENTOR_MENUS_VERSION,
176
+ true
177
+ );
178
+
179
+ wp_localize_script(
180
+ 'elementor-menus',
181
+ 'ElementorMenusConfig',
182
+ apply_filters( 'elementor_menus/editor/localize_settings', [] ),
183
+ [
184
+ 'expand' => __( 'expand child menu', 'elementor-menus' ),
185
+ 'collapse' => __( 'collapse child menu', 'elementor-menus' ),
186
+ ]
187
+ );
188
+ }
189
+
190
+ public function enqueue_panel_styles() {
191
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
192
+
193
+ wp_enqueue_style(
194
+ 'elementor-menus',
195
+ ELEMENTOR_MENUS_URL . 'assets/css/editor' . $suffix . '.css',
196
+ [
197
+ 'elementor-editor'
198
+ ],
199
+ ELEMENTOR_MENUS_VERSION
200
+ );
201
+ }
202
+
203
+ public function enqueue_default_scripts() {
204
+ wp_localize_script( 'elementor-menus-frontend', 'elementorScreenReaderText', array(
205
+ 'expand' => __( 'expand child menu', 'elementor-menus' ),
206
+ 'collapse' => __( 'collapse child menu', 'elementor-menus' ),
207
+ ) );
208
+ }
209
+
210
+ public function enqueue_panel_default_scripts() {
211
+ wp_localize_script( 'elementor-menus', 'elementorScreenReaderText', array(
212
+ 'expand' => __( 'expand child menu', 'elementor-menus' ),
213
+ 'collapse' => __( 'collapse child menu', 'elementor-menus' ),
214
+ ) );
215
+ }
216
+
217
+ public function elementor_init() {
218
+ $this->_modules_manager = new Manager();
219
+
220
+ // Add element category in panel
221
+ \Elementor\Plugin::instance()->elements_manager->add_category(
222
+ 'branding-elements',
223
+ [
224
+ 'title' => __( 'Header Elements', 'elementor-menus' ),
225
+ 'icon' => 'font',
226
+ ],
227
+ 1
228
+ );
229
+ }
230
+
231
+ protected function add_actions() {
232
+ add_action( 'elementor/init', [ $this, 'elementor_init' ] );
233
+
234
+ add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_panel_styles' ], 997 );
235
+ add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_panel_scripts' ], 997 );
236
+ add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_panel_default_scripts' ], 997 );
237
+
238
+ add_action( 'elementor/frontend/before_enqueue_scripts', [ $this, 'enqueue_scripts' ], 999 );
239
+ add_action( 'elementor/frontend/before_enqueue_scripts', [ $this, 'enqueue_default_scripts' ], 999 );
240
+ add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_styles' ], 998 );
241
+ }
242
+
243
+ /**
244
+ * Plugin constructor.
245
+ */
246
+ private function __construct() {
247
+ spl_autoload_register( [ $this, 'autoload' ] );
248
+
249
+ $this->_includes();
250
+
251
+ $this->add_actions();
252
+
253
+ if ( is_admin() ) {
254
+ //new Admin();
255
+ //new License\Admin();
256
+ }
257
+ }
258
+ }
259
+
260
+ if ( ! defined( 'ELEMENTOR_MENUS_TESTS' ) ) {
261
+ // In tests we run the instance manually.
262
+ Plugin::instance();
263
+ }
readme.txt CHANGED
@@ -1,43 +1,60 @@
1
- === NavMenu Addon For Elementor ===
2
-
3
- Contributors: WPDevHQ
4
- Tags: elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
5
- Requires at least: 4.4
6
- Tested up to: 4.7.2
7
- Stable tag: 1.0.0
8
- License: GPLv3
9
- License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
-
11
- Adds A Custom NavMenu Widget for the Elementor Page Builder
12
-
13
- == Description ==
14
- WARNING: Breaking Features!
15
- The upcoming update is a feature breaking release and I do sincenre apologize in advance.
16
- New version will now use the actual API for modules and introduces a) the options to set menu locations that are mobile ready + Site Branding!
17
-
18
- Custom WordPress navmenu specifically designed for the [Elementor Page Builder](https://wordpress.org/plugins/elementor/)
19
-
20
- == Installation ==
21
- * These instructions assumes you already have a WordPress site and the Elementor plugin installed and activated. Also, it is assumed that you already have at least a menu created.
22
-
23
- 1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the `wp-content/plugins/` directory of your WordPress installation.
24
- 2. Activate the plugin through the 'Plugins' menu in WordPress.
25
- 3. Go to Pages > Add New
26
- 4. While in the Elementor Editor, drag and drop the NavMenu widget to the location of your choice
27
- 4. Configure as desired and save.
28
- 5. Done! Enjoy :)
29
-
30
- == Frequently Asked Questions ==
31
-
32
- Non Yet!
33
-
34
- == Screenshots ==
35
-
36
- 1. Header With Twin Navigation.
37
-
38
- == Changelog ==
39
-
40
- = 1.0.0 =
41
- * Initial release.
42
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  Copyright: WPDevHQ https://wpdevhq.com
1
+ === NavMenu Addon For Elementor ===
2
+
3
+ Contributors: WPDevHQ
4
+ Tags: elementor, pagebuilder, page builder, page builder menu, page builder navmenu, menu builder, builder navigation menus, navigation, menus, navmenu, nav menu
5
+ Requires at least: 4.4
6
+ Tested up to: 4.7.2
7
+ Stable tag: 1.0.1
8
+ License: GPLv3
9
+ License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options
12
+
13
+ == Description ==
14
+ Custom WordPress navmenu specifically designed for the [Elementor Page Builder](https://wordpress.org/plugins/elementor/) - Now with Branding and menu location selectors
15
+
16
+ == Installation ==
17
+ * These instructions assumes you already have a WordPress site and the Elementor plugin installed and activated. Also, it is assumed that you already have at least a menu created.
18
+
19
+ 1. Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the `wp-content/plugins/` directory of your WordPress installation.
20
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
21
+ 3. Go to Pages > Add New
22
+ 4. While in the Elementor Editor, drag and drop the NavMenu widget to the location of your choice
23
+ 4. Configure as desired and save.
24
+ 5. Done! Enjoy :)
25
+
26
+ == Frequently Asked Questions ==
27
+
28
+ **I've added the menu element but I do not see the menus in the dropdown box**
29
+
30
+ Make sure that you have created your menus under Appearance >> Menus
31
+
32
+ **In the Branding module, I've selected the logo but it does not appear**
33
+
34
+ Make sure a) your theme supports the custom logo options and b) that a logo has been set in the theme's customizer.
35
+
36
+ **How do I make a split navigation with the Site title/logo in the middle?**
37
+
38
+ a: Go to Appearance >> Menus (if not already done so) and create two sets of menus - for brevity will call them Left Menu and Right Menu
39
+ b: Go to create a page (if not already done so), give it a title say Navigation Bar 1 and click Edit with Elementor. It is recommended to use a blank template for this - if your theme does not have you can use the Page Template plugin.
40
+ c: In the Edit mode insert a 3 column section into the page, adjust the middle column to be slight narrower than the 2 outer ones.
41
+ e: Drag and drop the NavMenu widget in to each of the outer columns and adjust setting as desired. Now drag and drop the Branding element into the middle column - adjust settings accordingly and save.
42
+ Done! :)
43
+
44
+ == Screenshots ==
45
+
46
+ 1. Header With Twin Navigation.
47
+
48
+ == Changelog ==
49
+
50
+ = 1.0.1 =
51
+ * NEW: Revised the plugin structure to me more modular and facilitate more element additions.
52
+ * NEW: Created a plugin specific elements category.
53
+ * NEW: Added option to select a menu location (up to 2) with both being mobile ready!
54
+ * NEW: Added a site branding module - you can now insert either the Site Title or the set Custom Logo in your headers.
55
+ * TWEAKS: Tiny but significant tweaks to make the whole experience more user friendly :)
56
+
57
+ = 1.0.0 =
58
+ * Initial release.
59
+
60
  Copyright: WPDevHQ https://wpdevhq.com
widgets/index.php DELETED
@@ -1,2 +0,0 @@
1
- <?php
2
- // Silence is golden.