Commit 85a0dd41121c09ba9cd1a9011fc4a9bbf15acfa2

FF and Mobile Usage proper initialisation
  
5454 //console.log('rendering custom menu..');
5555 this.$el.append(this.model.get('html'));
5656 }
57
58 this.updateNavIcon();
59
5760 this.$links = $('.nav > li');
5861 if(!this.$links) {
5962 throw new Error('Ill-formed menu! Please check you have <ul> element' +
7171 $(this.$links[pos]).addClass('active');
7272
7373 //$(this.$links[pos]).find('a p.navicon').addClass('active');
74 //this.updateNavIcon();
7574 },
7675 populate: function() {
7776 var item_template = _.template($('#nav-item-template').html());
9494 this.$links.removeClass('active');
9595 $('#navpos > li > a').find('p.navicon').removeClass('active');
9696
97 this.updateNavIcon();
98
9799 if(this.model.get('customMenu') === false) {
98100 if(!event) {
99101 var fragment = location.hash.split('/')[1];
134134 $(link).find('p.navicon').addClass('active');
135135 }
136136 }
137 //this.updateNavIcon();
138137 },
139 navIconPos: {
140 'home': '-8px',
141 'about': '-8px',
142 'global-radio': '-56px',
143 'signal-strength': '-90px',
144 'research-methodologies': '-80px',
145 'news': '-8px',
146 'contact': '-8px'
147 },
138 // update the navbar based on the page
148139 updateNavIcon: function() {
149140 var fragment = location.hash.split('/')[1];
150 var background = 'url("/static/img/nav-icons/'+fragment+'.svg") no-repeat';
151 $('.nav>li.nav-icon').css('background', background);
152 $('.nav>li.nav-icon').css('top', this.navIconPos[fragment]);
141 console.log('updating nav icon ', fragment);
142 if(fragment === 'home') {
143 $('#navpos').hide();
144 return;
145 }
146 $('#navpos').show();
153147 }
154148});
155149
151151 routes : {
152152 'signal-strength': 'showSigViz', //added for maraa CR portal
153153 'global-radio': 'showGlobalRadio', //added for maraa CR portal
154 'survey/:x': 'showSurvey', //added for maraa CR portal
155 'research': 'showResearch', //added for maraa CR portal
154 'frequency-finder': 'showFF', //added for maraa CR portal
155 'mobile-usage': 'showMU', //added for maraa CR portal
156 //'survey/:x': 'showSurvey', //added for maraa CR portal
157 //'research': 'showResearch', //added for maraa CR portal
156158 'news' : 'showNews', //added for maraa CR portal
157159 ':page' : 'showPage',
158160 ':page/:subpage': 'showPage',
159161 ':page/:subpage/:evenmore': 'showPage'
162 },
163 showFF: function() {
164 //bad hack to circumvent plugin loading problems
165 //not even foolproof.
166 //TODO: should implement plugin loaders
167 this.showPage('signal-strength');
168 try {
169 if(CRP.ff.init) {
170 CRP.ff.init();
171 }
172 else {
173 setTimeout(function() {
174 CRP.ff.init();
175 }, 2000);
176 }
177 } catch(e) {
178 setTimeout(function() {
179 CRP.ff.init();
180 }, 2000);
181 }
182 },
183 showMU: function() {
184 //bad hack to circumvent plugin loading problems
185 //not even foolproof.
186 //TODO: should implement plugin loaders
187 this.showPage('signal-strength');
188 try {
189 if(CRP.mv.init) {
190 CRP.mv.init();
191 }
192 else {
193 setTimeout(function() {
194 CRP.mv.init();
195 }, 2000);
196 }
197 } catch(e) {
198 setTimeout(function() {
199 CRP.mv.init();
200 }, 2000);
201 }
160202 },
161203 showSigViz: function() {
162204 //bad hack to circumvent plugin loading problems
  
2121
2222 <!--TODO: make this optional, only when there is a map plugin in the site. There
2323 is no need to load this for every site -->
24 <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
24 <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
2525 <!--[if lte IE 8]>
2626 <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
2727 <![endif]-->
28 <script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet-src.js"></script>
28 <script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
2929 {% block head %} {% endblock %}
3030 </head>
3131 <body>