Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
ulakbus-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ulakbus
ulakbus-ui
Commits
07e5cc53
Commit
07e5cc53
authored
Jul 06, 2015
by
Evren Kutar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
active menu item highlight
parent
402dfc28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
6 deletions
+34
-6
app.js
app/app.js
+29
-1
index.html
app/index.html
+5
-5
No files found.
app/app.js
View file @
07e5cc53
...
...
@@ -62,7 +62,35 @@ var app = angular.module(
sessionTimeout
:
'auth-session-timeout'
,
notAuthenticated
:
'auth-not-authenticated'
,
notAuthorized
:
'auth-not-authorized'
});
}).
/**
* Directive to highlight current menu item
*/
// todo: not working properly, get it done!
directive
(
'activeLink'
,
[
'$location'
,
function
(
$location
)
{
return
{
restrict
:
'A'
,
link
:
function
(
$scope
,
$element
,
$attrs
)
{
var
clazz
=
$attrs
.
activeLink
;
var
path
=
$location
.
path
();
path
=
path
//hack because path does not
// return including hashbang
$scope
.
location
=
$location
;
$scope
.
$watch
(
'location.path()'
,
function
(
newPath
)
{
if
(
path
===
newPath
)
{
console
.
log
(
path
,
newPath
);
$element
.
addClass
(
clazz
);
}
else
{
console
.
log
(
path
,
newPath
);
$element
.
removeClass
(
clazz
);
}
});
}
};
}]);
// test the code with strict di mode to see if it works when minified
//angular.bootstrap(document, ['zaerp'], {
...
...
app/index.html
View file @
07e5cc53
...
...
@@ -48,11 +48,11 @@
<div
class=
"row"
>
<div
class=
"col-sm-3 col-md-2 sidebar"
>
<ul
class=
"nav nav-sidebar"
>
<li><a
href=
"#/students"
>
Students
</a></li>
<li
class
=
"active"
><a
href=
"#/student/add"
>
New Student
</a></li>
<li><a
href=
"#/staffs"
>
Staffs
</a></li>
<li><a
href=
"#/staff/add"
>
New Staff
</a></li>
<li><a
href=
"#/input_types"
>
Types
</a></li>
<li
active-link=
"active"
><a
href=
"#/students"
>
Students
</a></li>
<li
active-link
=
"active"
><a
href=
"#/student/add"
>
New Student
</a></li>
<li
active-link=
"active"
><a
href=
"#/staffs"
>
Staffs
</a></li>
<li
active-link=
"active"
><a
href=
"#/staff/add"
>
New Staff
</a></li>
<li
active-link=
"active"
><a
href=
"#/input_types"
>
Types
</a></li>
</ul>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment