From 3ab295893086e40fe956ca918f0dcb333dcec683 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Mon, 24 Apr 2017 22:05:34 +0200 Subject: Document options parameter in saveLinkShare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- core/js/shareitemmodel.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index a11e785adc7..15af6df2c32 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -104,7 +104,14 @@ /** * Saves the current link share information. * - * This will trigger an ajax call and refetch the model afterwards. + * This will trigger an ajax call and, if successful, refetch the model + * afterwards. Callbacks "success", "error" and "complete" can be given + * in the options object; "success" is called after a successful save + * once the model is refetch, "error" is called after a failed save, and + * "complete" is called both after a successful save and after a failed + * save. Note that "complete" is called before "success" and "error" are + * called (unlike in jQuery, in which it is called after them); this + * ensures that "complete" is called even if refetching the model fails. * * TODO: this should be a separate model */ -- cgit v1.2.3