diff --git a/web/js/jquery.fuzzytoast.js b/web/js/jquery.fuzzytoast.js index af8ac70..2da5d45 100644 --- a/web/js/jquery.fuzzytoast.js +++ b/web/js/jquery.fuzzytoast.js @@ -50,7 +50,9 @@ destination : $.fuzzytoast.default_destination, method : $.fuzzytoast.default_method, append : $.fuzzytoast.default_append, + before : $.fuzzytoast.default_before, finished : $.fuzzytoast.default_finished, + complete : $.fuzzytoast.default_complete, success : $.fuzzytoast.default_success, parameters : parameters }, $.fuzzytoast.linkdata[id]); @@ -380,8 +382,11 @@ if (linkdata.success) { linkdata.success(destination, linkdata.model); } - if (linkdata.finished) { - linkdata.finished(); + if (linkdata.finished) { // NOTE: This approach is obsolete and will + linkdata.finished(); // be removed in version 2.0 + } + if (linkdata.complete) { + linkdata.complete(); } // If the link contains a "refresh" tag, we will reget the @@ -429,8 +434,11 @@ linkdata.error(errorDetails); } - if (linkdata.finished) { - linkdata.finished(); + if (linkdata.finished) { // NOTE: This approach is obsolete and will + linkdata.finished(); // be removed in version 2.0 + } + if (linkdata.complete) { + linkdata.complete(); } }; diff --git a/web/templates/instructions.html b/web/templates/instructions.html index 6965a8d..e8745fe 100644 --- a/web/templates/instructions.html +++ b/web/templates/instructions.html @@ -87,10 +87,10 @@

Usage

  • - finished + complete - A function called after either the success or error callbacks. Defaults to - $.fuzzytoast.default_finished + $.fuzzytoast.default_complete

  • @@ -98,7 +98,8 @@

    Usage

    - A callback function called before the requests for the template and data have been made. It is passed the destination, which allows a spinner to be inserted while the data is being - acquired. + acquired. Defaults to + $.fuzzytoast.default_before

    If this function returns a function, that is passed to all $.ajax() calls as a beforeSend @@ -155,10 +156,10 @@

    Usage

  • - $.fuzzytoast.default_finished + $.fuzzytoast.default_complete - A function name to be used for all - finished - requests. + completed requests. Called after + any success or error calls.