• Robert Knight's avatar
    Prevent double-posting of new annotations · f407141a
    Robert Knight authored
    When the user clicks the 'Post' button to create an annotation,
    optimistically switch the card back to View mode but display
    a 'Saving...' indicator in place of the Reply/Edit/Delete links.
    
    This makes the UI appear more responsive when the user clicks
    the Post button and also prevents an issue where the user could
    click 'Post' multiple times during the save and create multiple
    annotations.
    
     * Fix a possible inconsistency between the 'Post' button's enabled
       state and whether or not the save() function can succeed.
    
       The hasContent() and isShared() methods also already have tests,
       so this lets us remove several redundant tests.
    
     * Fix inconsistency in the return type of the save() function -
       always return a promise.
    
     * Treat negative status values as network errors as well as 0.
       If the server is unreachable, the real status value may be -1.
    
    Fixes #2864
    f407141a
Name
Last commit
Last update
..
test Loading commit data...
annotation.js Loading commit data...
deep-count.coffee Loading commit data...
dropdown-menu-btn.js Loading commit data...
excerpt.js Loading commit data...
form-input.coffee Loading commit data...
form-validate.coffee Loading commit data...
group-list.js Loading commit data...
h-autofocus.js Loading commit data...
login-form.js Loading commit data...
markdown.coffee Loading commit data...
publish-annotation-btn.js Loading commit data...
search-status-bar.js Loading commit data...
share-dialog.coffee Loading commit data...
sidebar-tutorial.js Loading commit data...
signin-control.js Loading commit data...
simple-search.coffee Loading commit data...
sort-dropdown.js Loading commit data...
spinner.js Loading commit data...
status-button.coffee Loading commit data...
thread-filter.coffee Loading commit data...
thread.coffee Loading commit data...
top-bar.js Loading commit data...
window-scroll.js Loading commit data...