Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // HISTORY JS
- // ====================================================================
- // This file contains all history, transitions and animatinos between pages.
- // ====================================================================
- var History = {
- entries: [],
- getSize: function(data) {
- return this.entries.length;
- },
- addEntry: function(action) {
- // Check to see if Entry exists, if not, add it
- if ( $.inArray(action, this.entries) == -1 ) {
- this.entries.push(action);
- }
- console.log(this.entries);
- },
- rewind: function(action) {
- if (this.getSize() <= 0) {
- return false;
- }
- // Remove last item from array
- this.entries.pop();
- // List current section
- var currentSection = this.entries[this.entries.length - 0];
- // List previous section
- var prevSection = this.entries[this.entries.length - 1];
- // Pull the current section Div ID
- var $container = $('#patientFlow .panel:visible').prop('id');
- // Hide the current section
- $('#' + $container).hide();
- // Show previous section of form
- effect[prevSection]();
- // Hide Back button from first section of form
- if ( this.entries.length == 1 ) {
- $backBtn.css('visibility', 'hidden');
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment