Skip to content
Snippets Groups Projects
Commit f0f4be06 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

small changes

parent c50e6cfb
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ body { ...@@ -28,7 +28,7 @@ body {
.navbar-header { .navbar-header {
padding-right: 0px; padding-right: 0px;
width: 100px; width: 104px;
} }
#logo { #logo {
......
...@@ -12,17 +12,18 @@ NavBar = Backbone.View.extend({ ...@@ -12,17 +12,18 @@ NavBar = Backbone.View.extend({
events: { events: {
"click #showHideMenu": "_setMenuVis", "click #showHideMenu": "_setMenuVis",
"click .menuHoverControls": "_setNavSelection", "click .menuHoverControls": "_setNavSelection"
"click .navDropdown": "_deselectAllNavItems"
}, },
initialize: function(){ initialize: function(){
_.bindAll(this, "_setMenuVis"); _.bindAll(this, "_setMenuVis", "_setNavSelection");
this.listenTo(this.model, "change:menuIsVisible", this._updateShowHideButton); this.listenTo(this.model, "change:menuIsVisible", this._updateShowHideButton);
this.listenTo(this.model, "change:currentNav", this._updateNavSelectionUI);
this._uiStuff(); this._uiStuff();
this._updateNavSelectionUI();
}, },
_setMenuVis: function(e){ _setMenuVis: function(e){
...@@ -44,11 +45,11 @@ NavBar = Backbone.View.extend({ ...@@ -44,11 +45,11 @@ NavBar = Backbone.View.extend({
_setNavSelection: function(e){ _setNavSelection: function(e){
e.preventDefault(); e.preventDefault();
var $link = $(e.target); var navSelection = $(e.target).data("menuId");
this._deselectAllNavItems(); if (navSelection == "about") {
$link.parent().addClass("open");//highlight $(e.target).blur();
var navSelection = $link.data("menuId"); return;
if (navSelection == "about") return; }
if (navSelection) { if (navSelection) {
if (navSelection=="navDesign") this.model.set("currentTab", "lattice", {silent: true}); if (navSelection=="navDesign") this.model.set("currentTab", "lattice", {silent: true});
else if (navSelection=="navSim") this.model.set("currentTab", "physics", {silent: true}); else if (navSelection=="navSim") this.model.set("currentTab", "physics", {silent: true});
...@@ -57,6 +58,15 @@ NavBar = Backbone.View.extend({ ...@@ -57,6 +58,15 @@ NavBar = Backbone.View.extend({
} }
}, },
_updateNavSelectionUI: function(){
this._deselectAllNavItems();
var navSelection = this.model.get("currentNav");
_.each($(".menuHoverControls"), function(link){
var $link = $(link);
if ($link.data("menuId") == navSelection) $link.parent().addClass("open");//highlight
});
},
_uiStuff: function(){ _uiStuff: function(){
var $logo = $("#logo"); var $logo = $("#logo");
$logo.mouseover(function(){ $logo.mouseover(function(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment