diff --git a/public/js/layout.js b/public/js/layout.js index 46b73d6..7f4b888 100644 --- a/public/js/layout.js +++ b/public/js/layout.js @@ -38,10 +38,13 @@ FadeManager.prototype.fadeOut = function(elements) { } } -function LayoutManager(viewName) { +/** + * Note: Used to pass viewName - now passes view (a JQuery object containing the view div.) + */ +function LayoutManager(view) { //PRIVATE MEMBERS var _this = this; - var view = $('[bs-view="' + viewName + '"]'); + //var view = $('[bs-view="' + viewName + '"]'); var lastUrl = null; var oldContainer = null; var container = null; @@ -94,7 +97,8 @@ function LayoutManager(viewName) { } else { view = null; - throw "view with name: '" + viewName + "' not found"; + //throw "view with name: '" + viewName + "' not found"; + throw "View does not exist!"; } //PRIVILEGED METHODS (public with private access) diff --git a/public/js/main.js b/public/js/main.js index 10f4d98..60683a4 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -9,16 +9,17 @@ window.status=""; //Handle the document ready event which is where any initialization code goes. $(document).ready(function($) { var content = $('#content'); - var viewName = "main-view"; - var view = $('[bs-view="' + viewName + '"]'); + //var viewName = "main-view"; + //var view = $('[bs-view="' + viewName + '"]'); if(!content || content.length != 1) { throw "Content div not found"; } - else if(!view || view.length != 1) { - throw "View with name: '" + viewName + "' not found"; - } + //else if(!view || view.length != 1) { + // throw "View with name: '" + viewName + "' not found"; + //} else { - var layoutManager = new LayoutManager("main-view"); + //var layoutManager = new LayoutManager("main-view"); + var layoutManager = new LayoutManager(view); //layoutManager.defaultUrl = '#!/holidays'; layoutManager.defaultUrl = '#!/Farm';