Ignore:
Timestamp:
2023-08-14T22:20:29+12:00 (10 months ago)
Author:
davidb
Message:

pos now stored inside TimelineState

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-installations/thewillow/trunk/interfaces/thewillow/js/thumbnail-timeline.js

    r37945 r37951  
    5050TimelineState.PosJump = TimelineState.CardWidthAndGap * 2;  /* nav-block move, two upper-cards at a time */
    5151
    52 
    53 let pos = TimelineState.StartPos;
     52TimelineState.pos = TimelineState.StartPos;
    5453
    5554
     
    6160    TimelineState.NumCards = num_cards;
    6261    TimelineState.CardsTotalWidth = Math.ceil((num_cards/2) * TimelineState.CardWidthAndGap) - ((TimelineState.CardWidth*2) + TimelineState.StartPos);
    63     console.log("cards total width  = " + TimelineState.CardsTotalWidth);
     62    // console.log("cards total width  = " + TimelineState.CardsTotalWidth);
    6463       
    65 
    6664    var httpPath  = gs.collectionMetadata["httpPath"];
    6765    var assocfilepath = gs.documentMetadata["assocfilepath"];
     
    102100function timelineBlockMove(event,inputs){
    103101    var dir = Array.from(inputs).indexOf(event.target);
    104     pos += (dir > 0) ? TimelineState.PosJump * -1 : TimelineState.PosJump
     102    TimelineState.pos += (dir > 0) ? TimelineState.PosJump * -1 : TimelineState.PosJump
    105103
    106     console.log("*** pos = " + pos);
     104    //console.log("*** pos = " + TimelineState.pos);
    107105   
    108106    var container = document.getElementsByClassName("timeline-container")[0];   
    109     container.style.transform = "translate3d(" + pos + "px, " + 0 + "px, 0)";
     107    container.style.transform = "translate3d(" + TimelineState.pos + "px, " + 0 + "px, 0)";
    110108
    111     if (pos < TimelineState.StartPos) {
     109    if (TimelineState.pos < TimelineState.StartPos) {
    112110    $('#timeline-nav-block-left').show();
    113111    }
     
    116114    }
    117115
    118     if (pos > -TimelineState.CardsTotalWidth ) {
     116    if (TimelineState.pos > -TimelineState.CardsTotalWidth ) {
    119117    $('#timeline-nav-block-right').show();
    120118    }
     
    134132    // Initialize thumbnail-timeline area
    135133    // .timeline-container is a static div
    136     document.getElementsByClassName("timeline-container")[0].style.transform = "translate3d(" + pos + "px, " + 0 + "px, 0)";
     134    document.getElementsByClassName("timeline-container")[0].style.transform = "translate3d(" + TimelineState.pos + "px, " + 0 + "px, 0)";
    137135   
    138136    // Attach listeners to move in "chunks" (blocks) the section of the timeline area on display
Note: See TracChangeset for help on using the changeset viewer.