• 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
..
annotator Loading commit data...
config Loading commit data...
directive Loading commit data...
filter Loading commit data...
test Loading commit data...
vendor Loading commit data...
annotation-mapper.js Loading commit data...
annotation-sync.coffee Loading commit data...
annotation-ui-controller.coffee Loading commit data...
annotation-ui-sync.coffee Loading commit data...
annotation-ui.coffee Loading commit data...
annotation-viewer-controller.coffee Loading commit data...
app-controller.coffee Loading commit data...
app.coffee Loading commit data...
auth-controller.js Loading commit data...
auth.js Loading commit data...
blocklist.js Loading commit data...
bridge.coffee Loading commit data...
create-group-form.js Loading commit data...
cross-frame.coffee Loading commit data...
date-util.js Loading commit data...
discovery.coffee Loading commit data...
drafts.js Loading commit data...
dropdown-menu.js Loading commit data...
events.js Loading commit data...
features.js Loading commit data...
flash.coffee Loading commit data...
form-respond.coffee Loading commit data...
groups.js Loading commit data...
host.coffee Loading commit data...
identity.coffee Loading commit data...
installer-controller.js Loading commit data...
karma-phantomjs-polyfill.js Loading commit data...
karma.config.js Loading commit data...
local-storage.coffee Loading commit data...
media-embedder.js Loading commit data...
permissions.coffee Loading commit data...
query-parser.coffee Loading commit data...
render.coffee Loading commit data...
search-filter.coffee Loading commit data...
session.js Loading commit data...
settings.js Loading commit data...
share-group-form.js Loading commit data...
site.js Loading commit data...
store.js Loading commit data...
stream-controller.coffee Loading commit data...
stream-filter.coffee Loading commit data...
streamer.js Loading commit data...
tags.coffee Loading commit data...
threading.coffee Loading commit data...
time.coffee Loading commit data...
ua-detect.js Loading commit data...
unicode.coffee Loading commit data...
view-filter.coffee Loading commit data...
websocket.js Loading commit data...
widget-controller.coffee Loading commit data...