Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

[TODO] Move in page JS to an external js sheet. #105

Closed
4 of 14 tasks
samuelgrant opened this issue May 1, 2018 · 2 comments
Closed
4 of 14 tasks

[TODO] Move in page JS to an external js sheet. #105

samuelgrant opened this issue May 1, 2018 · 2 comments

Comments

@samuelgrant
Copy link
Collaborator

samuelgrant commented May 1, 2018

I want to move the majority of the java-script to a minified js file. The idea is that each page will have core javascript in the page only as well as a document load and a timers function for polling. Everything else should be moved so I can cut down on clutter.

footer.njk - globals

fcFleetManagement.njk

@samuelgrant
Copy link
Collaborator Author

samuelgrant commented May 1, 2018

The bottom of each view should only have this where possible plus any very specific one page javascript snippets.

<script>
    //On page load
    $( document ).ready(function() {
       //put any view specific functions here that need to be called once after page load
    });

    //Start Timer
    setInterval(function()
    { 
      //put any view specific functions here that need to be called on a timer 
    }, 15000);//Every 15 seconds
</script>

@samuelgrant
Copy link
Collaborator Author

Any part of the script that requires variables needs to be within the view file in the footer.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant