• Robert Knight's avatar
    Update the displayed annotation timestamp immediately after creation/update · 37e2407a
    Robert Knight authored
    There were two problems here:
    
     1. The periodic interval for updating the timestamp was never started
        for new annotations because the initial call to updateTimestamp()
        was a no-op for annotations that had no timestamp yet.
    
     2. domainModel.updated was never updated after an annotation
        was saved to the server and hence the call to
        updateTimestamp() re-used the old timestamp.
    
    (1) is fixed now by restarting the interval using the current
    last-updated timestamp whenever the view model is updated.
    
    (2) is fixed indirectly now by moving the logic to update
    the timestamp into updateViewModel(), so that all updates
    to it happen in one place. When an annotation is updated,
    the updated domain model returned by the server is the one
    passed into updateViewModel() to update it.
    
     * Separate out the logic for creating a decaying interval
       whose frequency depends on the age of some input timestamp,
       and updating the timestamp string on each interval.
    
       The decaying interval is now handled by 'time.decayingInterval'
    
     * Trigger a restart of the interval whenever the view model is
       updated in response to a change to the annotation
    
    Fixes #2819
    Fixes #2822
    37e2407a
Name
Last commit
Last update
..
annotation-test.js Loading commit data...
excerpt-test.js Loading commit data...
form-input-test.coffee Loading commit data...
form-validate-test.coffee Loading commit data...
group-list-test.js Loading commit data...
publish-annotation-btn-test.js Loading commit data...
search-status-bar-test.js Loading commit data...
share-dialog-test.coffee Loading commit data...
simple-search-test.coffee Loading commit data...
sort-dropdown-test.js Loading commit data...
spinner-test.js Loading commit data...
status-button-test.coffee Loading commit data...
thread-test.coffee Loading commit data...
util.js Loading commit data...
window-scroll-test.js Loading commit data...