Fix some small bugs with Dashboard navigation links

This commit is contained in:
Duncan Sommerville 2015-08-26 17:02:01 -04:00
parent 7d8c6dc90d
commit ef892bb565
2 changed files with 10 additions and 10 deletions

View File

@ -18,9 +18,9 @@ $pages = array(
array(
'label' => "<i class='icon-calendar icon-white'></i>"._('Calendar'),
'module' => 'default',
'controller' => 'Schedule',
'controller' => 'schedule',
'action' => 'index',
'resource' => 'schedule'
'resource' => 'schedule'
),
array(
'label' => "<i class='icon-wrench icon-white'></i>"._('Widgets'),
@ -48,13 +48,13 @@ $pages = array(
'resource' => 'preference',
'action' => 'index',
'module' => 'default',
'controller' => 'Preference',
'controller' => 'preference',
'title' => 'Settings',
'pages' => array(
array(
'label' => _('General'),
'module' => 'default',
'controller' => 'Preference'
'controller' => 'preference'
),
array(
'label' => _('My Profile'),
@ -72,7 +72,7 @@ $pages = array(
array(
'label' => _('Streams'),
'module' => 'default',
'controller' => 'Preference',
'controller' => 'preference',
'action' => 'stream-setting'
)
)

View File

@ -121,6 +121,7 @@ AIRTIME = (function(AIRTIME) {
$(".media_type_selector:first").addClass("highlight");
var selected;
if (location.hash === "") {
location.hash = "tracks";
selected = $("a[href$='#tracks']");
} else {
selected = $("a[href$='"+location.hash+"']");
@ -137,10 +138,9 @@ AIRTIME = (function(AIRTIME) {
$(window).on('hashchange', function() {
var selected = $("a[href$='"+location.hash+"']");
// If we click Dashboard from one of the media views, do nothing
if (!location.hash) {
return;
}
var dashboardLink = $(".media_type_selector:first");
dashboardLink.find("a").attr("href", selected.attr("href"));
AIRTIME.library.selectNone();
$(".media_type_selector").each(function () {
$(this).removeClass("selected");
@ -149,7 +149,7 @@ AIRTIME = (function(AIRTIME) {
oTable.fnDraw();
$("#library_filter").text(selected.text());
// Highlight the dashboard link
$(".media_type_selector:first").addClass("highlight");
dashboardLink.addClass("highlight");
});
}