Provide option to set ajax indicator with .use-ajax and .use-ajax-submit

Created on 14 October 2016, about 8 years ago
Updated 20 April 2023, over 1 year ago

I suggest adding an option to set the progress indicator on ajax links/buttons, targeted with classes .use-ajax and .use-ajax-submit like it is possible to set dialog-type and dialog-options:

element_settings.dialogType = $(this).data('dialog-type');
element_settings.dialog = $(this).data('dialog-options');

My suggestions is to keep the throbber default (seems obvious) and then add an option to override it with a data attribute named data-progress-type:

// Provide clicked links with a throbber as the default indicator,
// instead of the progress bar, since it looks better.
var progress_type = $(this).data('progress-type');
element_settings.progress = {type: progress_type ? progress_type : 'throbber'};

We're basically just providing the options to set the indicator to ex: fullscreen like we do in the Form API.
So I guess all the cases that made it relevant for #ajax in Form API also applies here. But let me know if you want some actual cases.

Feature request
Status

Needs work

Version

10.1

Component
Ajax 

Last updated about 4 hours ago

Created by

🇩🇰Denmark kallehauge

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024