diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-05-04 13:54:15 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-05-04 13:54:15 -0400 |
| commit | 2820e892db42916d683a87ca626546130cbb3837 (patch) | |
| tree | ab2414bdfaecdb02da1c3938fe0f0d82e995f12b /site/public/assets/javascripts/_env.js | |
| parent | c1a42462c299c3ccb8356951626cb90d24bd95d2 (diff) | |
fix galleries and all page
Diffstat (limited to 'site/public/assets/javascripts/_env.js')
| -rw-r--r-- | site/public/assets/javascripts/_env.js | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/site/public/assets/javascripts/_env.js b/site/public/assets/javascripts/_env.js index a8e1146..c7f8607 100644 --- a/site/public/assets/javascripts/_env.js +++ b/site/public/assets/javascripts/_env.js @@ -89,20 +89,7 @@ environment.ready = function(){ }) }) */ - $("nav .index").click(function (e){ - e && e.preventDefault() - if (done_loading && window.location.hash == "#/index") return - // window.location.hash = "#/index" - - $("nav a.active").removeClass("active") - open_entry() - - $("#entry_container").removeClass("visible") - var $loader = $("<div>") - $loader.load("all .entry", function(){ - display_entry($loader.children()[0]) - }) - }) + // $("nav .index").click() $(".toggleRapper").click(toggle_menu) $(document).on("click", ".project", function(){ @@ -116,7 +103,8 @@ environment.ready = function(){ $('.cat.active, .sub.active, .sub.a').addClass('active') controls.pause() window.location.hash = "#" - $(".index").trigger("click") + // $(".index").trigger("click") + load_index() // hide_entry() }) @@ -313,6 +301,23 @@ function build_scene () { var entry_open_time = 0; +function load_index (e){ + e && e.preventDefault() + // if (done_loading && window.location.hash == "#/index") return + // window.location.hash = "#/index" + console.log("load index") + + $("nav a.active").removeClass("active") + open_entry() + + $("#entry_container").removeClass("visible") + var $loader = $("<div>") + $loader.load("all .entry", function(){ + console.log("index did load") + display_entry($loader.children()[0]) + }) +} + function as_hash (txt) { return txt.replace(/\s/g,'_') } @@ -391,7 +396,8 @@ function toggle_menu (isInitialLoad){ if (menu_open && isInitialLoad !== false) { controls.pause() - $(".index").trigger("click") + // $(".index").trigger("click") + load_index() } if (! menu_open && entry_open && ! is_mobile) { entry_open = false @@ -488,6 +494,7 @@ function build_gallery () { }) gallery.loader.on("progress", function(imagesLoaded, loadingImage){ $(loadingImage.img).addClass('loaded') + $(loadingImage.img).parent().removeClass('loading') }) $(".nextbutton").click(function(){ gallery.next() }) $(".prevbutton").click(function(){ gallery.previous() }) |
