summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Albo <gabriel@albo.com.br>2015-02-25 14:54:11 -0300
committerGabriel Albo <gabriel@albo.com.br>2015-02-25 14:54:11 -0300
commite18b3539f8f08325fff32f9f9f39cdf4296d38d4 (patch)
treef5818cb68c0be7921705ffedfcd285af280652af
parent622ce98bf08d58584fe4af7e8967a7d579823ca2 (diff)
#296 Moving the toggle control script to the tags hbs file so clicking on the tags icon now toggles the left nav. Next: extracting this JS to a proper place.
-rw-r--r--web-ui/app/index.html17
-rw-r--r--web-ui/app/scss/styles.scss13
-rw-r--r--web-ui/app/templates/tags/tag_list.hbs15
3 files changed, 23 insertions, 22 deletions
diff --git a/web-ui/app/index.html b/web-ui/app/index.html
index 7a8f335f..79d7be69 100644
--- a/web-ui/app/index.html
+++ b/web-ui/app/index.html
@@ -23,7 +23,7 @@
<a class="left-off-canvas-logo" href="#">
<img id="pixelated-logo" src="/assets/images/pixelated-logo-orange.svg" alt="Pixelated">
</a>
- <a class="fake-left-off-canvas-toggle" href="#">
+ <a class="side-nav-toggle side-nav-toggle-icon" href="#">
<i class="toggle fa fa-navicon"></i>
</a>
<nav id="tag-list"></nav>
@@ -79,23 +79,8 @@
<script src="assets/bower_components/requirejs/require.js" data-main="assets/js/main.js"></script>
<!--usemin_end-->
-
-
<script>
$(document).foundation();
</script>
-
-<script>
-$('.fake-left-off-canvas-toggle').click(function (ev) {
- ev.preventDefault();
- $('.left-off-canvas-toggle').click();
- if ($('#custom-tag-list').hasClass('expanded')) {
- $('#custom-tag-list').removeClass('expanded');
- }
- else {
- $('#custom-tag-list').addClass('expanded');
- }
- });
-</script>
</body>
</html>
diff --git a/web-ui/app/scss/styles.scss b/web-ui/app/scss/styles.scss
index 5cbe1ca5..819cb644 100644
--- a/web-ui/app/scss/styles.scss
+++ b/web-ui/app/scss/styles.scss
@@ -514,22 +514,25 @@ button {
}
}
-.fake-left-off-canvas-toggle {
+.side-nav-toggle, .side-nav-toggle-icon {
color: white;
+ cursor: pointer;
&:hover, &:focus {
color: white;
}
+ background: $secondary;
+ &.logout {
+ color: $action_buttons;
+ }
+}
+.side-nav-toggle-icon {
padding: 9px 0px 8px 19px;
display: block;
left: 0;
- background: $secondary;
top: 0;
position: relative;
- &.logout {
- color: $action_buttons;
- }
}
.left-off-canvas-logo {
diff --git a/web-ui/app/templates/tags/tag_list.hbs b/web-ui/app/templates/tags/tag_list.hbs
index 071b4799..e6108224 100644
--- a/web-ui/app/templates/tags/tag_list.hbs
+++ b/web-ui/app/templates/tags/tag_list.hbs
@@ -1,6 +1,19 @@
<ul id="default-tag-list"></ul>
-<div class="tags-icon">
+<div class="tags-icon side-nav-toggle">
<i class="fa fa-tags"></i>
<span class="tag-label">Tags</span>
</div>
<ul id="custom-tag-list"></ul>
+
+<script>
+$('.side-nav-toggle').click(function (ev) {
+ ev.preventDefault();
+ $('.left-off-canvas-toggle').click();
+ if ($('#custom-tag-list').hasClass('expanded')) {
+ $('#custom-tag-list').removeClass('expanded');
+ }
+ else {
+ $('#custom-tag-list').addClass('expanded');
+ }
+ });
+</script> \ No newline at end of file