From ef892bb565a966bff60880af5abdb052e449706d Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Wed, 26 Aug 2015 17:02:01 -0400 Subject: [PATCH] Fix some small bugs with Dashboard navigation links --- airtime_mvc/application/configs/navigation.php | 10 +++++----- .../public/js/airtime/showbuilder/main_builder.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/application/configs/navigation.php b/airtime_mvc/application/configs/navigation.php index 5d9c71fd7..b54356f5c 100644 --- a/airtime_mvc/application/configs/navigation.php +++ b/airtime_mvc/application/configs/navigation.php @@ -18,9 +18,9 @@ $pages = array( array( 'label' => ""._('Calendar'), 'module' => 'default', - 'controller' => 'Schedule', + 'controller' => 'schedule', 'action' => 'index', - 'resource' => 'schedule' + 'resource' => 'schedule' ), array( 'label' => ""._('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' ) ) diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 8dc45ea05..e114d677e 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -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"); }); }