<h4>, <h5> or <h6> to only <h3>s, with a <h2> hidden heading above them.
If you are styling or scripting the headings in a custom way, this change
will require updates to your site's CSS or JS.
+* (bug 41342) jquery.suggestions should cancel any active (async) fetches
+ before it triggers another fetch.
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat.
$.suggestions = {
/**
- * Cancel any delayed updateSuggestions() call and inform the user so
- * they can cancel their result fetching if they use AJAX or something
+ * Cancel any delayed maybeFetch() call and callback the context so
+ * they can cancel any async fetching if they use AJAX or something.
*/
cancel: function ( context ) {
if ( context.data.timerID !== null ) {
}
}
- // Cancel previous call
- if ( context.data.timerID !== null ) {
- clearTimeout( context.data.timerID );
- }
+ // Cancels any delayed maybeFetch call, and invokes context.config.cancel.
+ $.suggestions.cancel( context );
+
if ( delayed ) {
- // Start a new asynchronous call
+ // To avoid many started/aborted requests while typing, we're gonna take a short
+ // break before trying to fetch data.
context.data.timerID = setTimeout( maybeFetch, context.config.delay );
} else {
maybeFetch();