diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index b7b14696c..8dc0ff55c 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -50,30 +50,6 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= - diff --git a/airtime_mvc/public/js/airtime/common/common.js b/airtime_mvc/public/js/airtime/common/common.js index b467aeedb..bbd58145f 100644 --- a/airtime_mvc/public/js/airtime/common/common.js +++ b/airtime_mvc/public/js/airtime/common/common.js @@ -230,9 +230,3 @@ function getUsabilityHint() { }); } -$(document).mouseup(function (e) { - var mb = $("#menu-btn"), w = $(window).width(); - if (!mb.is(e.target) && mb.has(e.target).length === 0 && w <= 970) { - $('#nav').find('.responsive-menu').slideUp(); - } -}); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 31c2f1219..fd551786b 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -1322,6 +1322,7 @@ var validationTypes = { "year" : "i" }; + $(document).ready(function() { $('.active-tab .md-save').live("click", function() { var file_id = $('#file_id').val(), @@ -1345,44 +1346,6 @@ $(document).ready(function() { } }); - if (location.hash === "") { - $("a[href$='#files']").parent().addClass("selected"); - } - $("a[href$='"+location.hash+"']").parent().addClass("selected"); - - // Slightly hacky way of triggering the click event when it's outside of the anchor text - $(".media_type_selector").on("click", function() { - // Need get(0) here so we don't create a stack overflow by recurring the click on the parent - $(this).find("a").get(0).click(); - }); - - $(window).on('hashchange', function() { - // If we click Dashboard from one of the media views, do nothing - if (!location.hash) { - return; - } - AIRTIME.library.selectNone(); - $(".media_type_selector").each(function () { - $(this).removeClass("selected"); - }); - $("a[href$='"+location.hash+"']").parent().addClass("selected"); - oTable.fnDraw(); - }); - - /* Overridden by hashchange function - - $(".media_type_selector").on("click", function() { - if (!$(this).hasClass("selected")) { - AIRTIME.library.selectNone(); - $(".media_type_selector").each(function () { - $(this).removeClass("selected"); - }); - $(this).addClass("selected"); - oTable.fnDraw(); - } - }); - */ - $("#advanced-options").on("click", function() { resizeAdvancedSearch(); }); diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 768b24d55..c94274555 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -143,6 +143,35 @@ AIRTIME = (function(AIRTIME) { } } + function highlightMediaTypeSelector() + { + if (location.hash === "") { + $("a[href$='#files']").parent().addClass("selected"); + } + $("a[href$='"+location.hash+"']").parent().addClass("selected"); + + // Slightly hacky way of triggering the click event when it's outside of the anchor text + $(".media_type_selector").on("click", function() { + // Need get(0) here so we don't create a stack overflow by recurring the click on the parent + $(this).find("a").get(0).click(); + }); + + $(window).on('hashchange', function() { + + // If we click Dashboard from one of the media views, do nothing + if (!location.hash) { + return; + } + AIRTIME.library.selectNone(); + $(".media_type_selector").each(function () { + $(this).removeClass("selected"); + }); + $("a[href$='"+location.hash+"']").parent().addClass("selected"); + oTable.fnDraw(); + }); + } + + mod.onReady = function() { // Normally we would just use audio/*, but it includes file types that we can't handle (like .m4a) // We initialize the acceptedMimeTypes variable in Bootstrap so we don't have to duplicate the list @@ -171,6 +200,9 @@ AIRTIME = (function(AIRTIME) { } }); + //Highlight the media type selector we're currently on. + highlightMediaTypeSelector(); + /* * Icon hover states for search. */