Anaibi/enjoyMondays-website

logo animation called two times when reloading from page other than home

Closed this issue · 4 comments

check logo animation calls, queue, etc.

  • if the page is loaded for the first time, it doesn't happen, only on refresh
  • if the scroll position on refresh is such that home still has big logo, it doesn't happen
  • all else cases, happens

--> it's forced by waypoint functionality being called / activated on returning to home position.

--> should detect if page is being refreshed rather then clicked or scrolled and stop call in that case

actually, all reloads of page behave different, depending on where in the page when reloading --> fix var page/ page, seems keeps some kind of value on reload:
///////////////////////////
first load:
main.js:15 0
main.js:74 in waypoint function, direction down, from .page header page has value = undefined //this should not be called
main.js:77 in waypoint direction down, from .page header, after update links called, page has value = #home //this should not be called
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:258 scroll to position called page has value = #home //shouldn't need to be called either
////////////////////////////////////////////////////
on reload without doing anything else but reloading, exactly same log
////////////////////////////////////////////////////
scrolling down and up before refreshing:
main.js:15 0
main.js:74 in waypoint function, direction down, from .page header page value = undefined
main.js:77 in waypoint direction down, from .page header, after update links called, page value = #home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:258 scroll to position called page value = #home

//all above is on load log
//below, scrolling down
main.js:45 in waypoint home, down, small logo page value = [object HTMLElement] // should be ok, not logging out correct value, not real problem
main.js:85 in waypoint function, direction up, from .page page value = undefined
main.js:88 in waypoint direction up, from .page, after update links called, page value = #home //waypoint waits untill end scrolling to update page value
main.js:55 in waypoint home, up, big logo page value = [object HTMLElement]

//////////////////////////
reloading / refreshing from work page/section (page value is set = 'home' in initialization)
main.js:15 0
main.js:16 home
main.js:74 in waypoint function, direction down, from .page header page value = undefined
main.js:77 in waypoint direction down, from .page header, after update links called, page value = #home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
main.js:45 in waypoint home, down, small logo page value = home
main.js:74 in waypoint function, direction down, from .page header page value = undefined
main.js:77 in waypoint direction down, from .page header, after update links called, page value = #work
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:65 in waypoint called from home header, direction up, page value = home
main.js:85 in waypoint function, direction up, from .page value = undefined
main.js:88 in waypoint direction up, from .page, after update links called, page value = #home
main.js:55 in waypoint home, up, big logo page value = home
main.js:258 scroll to position called page value = #work
main.js:45 in waypoint home, down, small logo page value = home
main.js:74 in waypoint function, direction down, from .page header page value = undefined
main.js:77 in waypoint direction down, from .page header, after update links called, page value = #work

////////////////////////////////////////////////////
taking out inside function declarations of var page
main.js:15 0
main.js:16 home
main.js:74 in waypoint function, direction down, from .page header page value = home
main.js:78 in waypoint direction down, from .page header, after update links called, page value = #home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:260 scroll to position called page value = #home

////////////////////////////////////////////////////
load and scroll to work:
main.js:15 0
main.js:16 page value = home
main.js:74 in waypoint function, direction down, from .page header page value = home
main.js:78 in waypoint direction down, from .page header, after update links called, page value = #home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:260 scroll to position called #home
main.js:260 scroll to position called #work
main.js:45 in waypoint home, down, small logo page value = #work
main.js:74 in waypoint function, direction down, from .page header page value = #work
main.js:78 in waypoint direction down, from .page header, after update links called, page value = #work

////////////////////////////////////////////////////
reloading from work page:
main.js:15 0
main.js:16 home
main.js:74 in waypoint function, direction down, from .page header home
main.js:78 in waypoint direction down, from .page header, after update links called, page #home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
main.js:45 in waypoint home, down, small logo #home
main.js:74 in waypoint function, direction down, from .page header #home
main.js:78 in waypoint direction down, from .page header, after update links called, page #work
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:65 in waypoint called from home header, direction up, page #work
main.js:86 in waypoint function, direction up, from .page #work
main.js:90 in waypoint direction up, from .page, after update links called, page #home
main.js:55 in waypoint home, up, big logo #home
main.js:260 scroll to position called #home

--> it keeps value of last page called, goes back to it, and then BACK to home.. waypoint functionality to keep in memory section visited and return to it on refresh.. but this web is not using that, so either should take out, modify, or prevent.
(AND, page doesn't stop loading, seems)

saving call to waypoint untill page loaded and layout setted, brings out this!:
main.js:15 0
main.js:16 home
main.js:18 [div#firstLoad.hidden, context: document, selector: "#firstLoad", jquery: "1.10.2", constructor: function, init: function…]
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
main.js:188 [div#firstLoad.hidden, context: document, selector: "#firstLoad", jquery: "1.10.2", constructor: function, init: function…]
main.js:209 [div#firstLoad.hidden, context: document, selector: "#firstLoad", jquery: "1.10.2", constructor: function, init: function…]
main.js:51 in waypoint home, down, small logo #home
main.js:80 in waypoint function, direction down, from .page header #home
main.js:84 in waypoint direction down, from .page header, after update links called, page #home
main.js:80 in waypoint function, direction down, from .page header #home
main.js:84 in waypoint direction down, from .page header, after update links called, page #work
main.js:80 in waypoint function, direction down, from .page header #work
main.js:84 in waypoint direction down, from .page header, after update links called, page #about
main.js:80 in waypoint function, direction down, from .page header #about
main.js:84 in waypoint direction down, from .page header, after update links called, page #contact
main.js:103 in waypoint function, direction down, from #contact sub-header #contact
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:61 in waypoint home, up, big logo #contact
main.js:71 in waypoint called from home header, direction up, page #contact
main.js:92 in waypoint function, direction up, from .page #contact
main.js:96 in waypoint direction up, from .page, after update links called, page #home
main.js:92 in waypoint function, direction up, from .page #home
main.js:96 in waypoint direction up, from .page, after update links called, page #work
main.js:92 in waypoint function, direction up, from .page #work
main.js:96 in waypoint direction up, from .page, after update links called, page #about
main.js:92 in waypoint function, direction up, from .page #about
main.js:96 in waypoint direction up, from .page, after update links called, page #contact
main.js:108 in waypoint direction up, from #contact sub-header, after update links called, page #contact
main.js:266 scroll to position called #contact
main.js:51 in waypoint home, down, small logo #contact
main.js:80 in waypoint function, direction down, from .page header #contact
main.js:84 in waypoint direction down, from .page header, after update links called, page #work
main.js:80 in waypoint function, direction down, from .page header #work
main.js:84 in waypoint direction down, from .page header, after update links called, page #about
main.js:80 in waypoint function, direction down, from .page header #about
main.js:84 in waypoint direction down, from .page header, after update links called, page #contact

come on!!! grrrr

ok, doing exhaustive look up, due to diverse loading issues (loading time, loading not stoping, etc)
on first load:
home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
main.js:24 1fade out called
main.js:185 2 setPageHeight called, page value = home
main.js:206 3 setLayout called, page value = home
main.js:230 4 setHeaderClass called, page value = home
main.js:277 5 isPage called, page value = #home
main.js:300 6 hideFooter called, page value = #home
main.js:254 7 centerContents called, page value = #home
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:222 8 setTimeout, (fixHeader, scrollToPosition) called, page value = #home
main.js:243 9 fixHeader called, page value = #home
main.js:281 10 isLandscapeHeader called, page value = #home
main.js:263 11 scrollToPosition called, page value = #home

on reload from about page:
home
supersized.3.2.5.js:44 -INITIALIZING!
supersized.3.2.5.js:74 -BASE BUILD!
supersized.3.2.5.js:148 -BASE START!
main.js:46 NaN page value = home
main.js:49 2 down, page value = home
main.js:281 3 isLandscapeHeader called, page value = home
main.js:52 4 !isLandscapeHeader, home, small logo, page value = home
main.js:142 5 small logo called, page value = home
main.js:164 6 moveMenu called, page value = home
main.js:78 7waypoint called from .page header, offset 50%, page value = home
main.js:79 8 down, get page, updatelinks, page value = home
main.js:178 9 updateLinks called, page value = #home
main.js:83 9 down, updated links, page value = #home
main.js:70 10waypoint called from #home header, no offset, page value = #home
main.js:89 11waypoint called from .page, offset bottom-in-view, page value = #home
main.js:78 12waypoint called from .page header, offset 50%, page value = #home
main.js:79 13 down, get page, updatelinks, page value = #home
main.js:178 14 updateLinks called, page value = #work
main.js:83 14 down, updated links, page value = #work
main.js:89 15waypoint called from .page, offset bottom-in-view, page value = #work
main.js:78 16waypoint called from .page header, offset 50%, page value = #work
main.js:79 17 down, get page, updatelinks, page value = #work
main.js:178 18 updateLinks called, page value = #about
main.js:83 18 down, updated links, page value = #about
main.js:89 19waypoint called from .page, offset bottom-in-view, page value = #about
main.js:78 20waypoint called from .page header, offset 50%, page value = #about
main.js:79 21 down, get page, updatelinks, page value = #about
main.js:178 22 updateLinks called, page value = #contact
main.js:83 22 down, updated links, page value = #contact
main.js:89 23waypoint called from .page, offset bottom-in-view, page value = #contact
main.js:99 24waypoint called from #contact sub-header, offset bottom-in-view, page value = #contact
main.js:100 25 down, showFooter, page value = #contact
main.js:291 26 showFooter called, page value = #contact
supersized.3.2.5.js:201 --IMAGE LOADED!
supersized.3.2.5.js:237 LAUNCHING SUPERSIZED!
supersized.shutter.js:77 -- THEME INIT
main.js:24 27fade out called
main.js:185 28 setPageHeight called, page value = #contact
main.js:206 29 setLayout called, page value = #contact
main.js:230 30 setHeaderClass called, page value = #contact
main.js:277 31 isPage called, page value = #contact
main.js:254 32 centerContents called, page value = #contact
main.js:78 33waypoint called from .page header, offset 50%, page value = #contact
main.js:78 34waypoint called from .page header, offset 50%, page value = #contact
main.js:89 35waypoint called from .page, offset bottom-in-view, page value = #contact
main.js:90 36 up, from .page, get page, updateLinks, page value = #contact
main.js:178 37 updateLinks called, page value = #about
main.js:94 37 in waypoint direction up, from .page, after update links called, page #about
main.js:89 38waypoint called from .page, offset bottom-in-view, page value = #about
main.js:90 39 up, from .page, get page, updateLinks, page value = #about
main.js:178 40 updateLinks called, page value = #contact
main.js:94 40 in waypoint direction up, from .page, after update links called, page #contact
main.js:99 41waypoint called from #contact sub-header, offset bottom-in-view, page value = #contact
main.js:103 42 up, hideFooter, page value = #contact
main.js:300 43 hideFooter called, page value = #contact
main.js:89 44waypoint called from .page, offset bottom-in-view, page value = #contact
main.js:90 45 up, from .page, get page, updateLinks, page value = #contact
main.js:178 46 updateLinks called, page value = #work
main.js:94 46 in waypoint direction up, from .page, after update links called, page #work
main.js:78 47waypoint called from .page header, offset 50%, page value = #work
main.js:89 48waypoint called from .page, offset bottom-in-view, page value = #work
main.js:90 49 up, from .page, get page, updateLinks, page value = #work
main.js:178 50 updateLinks called, page value = #home
main.js:94 50 in waypoint direction up, from .page, after update links called, page #home
main.js:70 51waypoint called from #home header, no offset, page value = #home
main.js:71 52 up, updateLinks, page value = #home
main.js:178 53 updateLinks called, page value = #home
main.js:78 54waypoint called from .page header, offset 50%, page value = #home
main.js:46 NaN page value = #home
main.js:58 56 up, page value = #home
main.js:281 57 isLandscapeHeader called, page value = #home
main.js:62 58 !isLandscapeHeader, big logo, page value = #home
main.js:130 59 big logo called, page value = #home
main.js:164 60 moveMenu called, page value = #home
main.js:222 61 setTimeout, (fixHeader, scrollToPosition) called, page value = #home
main.js:243 62 fixHeader called, page value = #home
main.js:281 63 isLandscapeHeader called, page value = #home
main.js:263 64 scrollToPosition called, page value = #home

now do some cleaning up