Loading config/schema/views_bulk_operations.views.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ views.field.views_bulk_operations_bulk_form: form_step: type: boolean label: 'Display configuration form on a separate page' ajax_loader: type: boolean label: 'Show throbber on VBO ajax petitions.' buttons: type: boolean label: 'Display action options as buttons' Loading js/frontUi.js +8 −2 Original line number Diff line number Diff line Loading @@ -128,14 +128,20 @@ var $selectionInfo = this.$selectionInfo; var target_uri = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + 'views-bulk-operations/ajax/' + this.view_id + '/' + this.display_id; var ajaxDrupal = Drupal.ajax({ var ajax_options = { url: target_uri, progress: false, submit: { list: list, op: op } }); }; if (drupalSettings.hasOwnProperty('vbo') && drupalSettings.vbo.hasOwnProperty('ajax_loader') && drupalSettings.vbo.ajax_loader) { ajax_options.progress = { type: 'fullscreen' }; } var ajaxDrupal = Drupal.ajax(ajax_options); ajaxDrupal.original_success = ajaxDrupal.success; ajaxDrupal.success = function (data, status) { Loading src/Plugin/views/field/ViewsBulkOperationsBulkForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,7 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe $options['batch'] = ['default' => TRUE]; $options['batch_size'] = ['default' => 10]; $options['form_step'] = ['default' => TRUE]; $options['ajax_loader'] = ['default' => FALSE]; $options['buttons'] = ['default' => FALSE]; $options['clear_on_exposed'] = ['default' => TRUE]; $options['action_title'] = ['default' => $this->t('Action')]; Loading Loading @@ -432,6 +433,13 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe '#access' => FALSE, ]; $form['ajax_loader'] = [ '#type' => 'checkbox', '#title' => $this->t('Show ajax throbber.'), '#description' => $this->t('With this enabled, a throbber will be shown when an ajax petition from VBO is triggered.'), '#default_value' => $this->options['ajax_loader'], ]; $form['buttons'] = [ '#type' => 'checkbox', '#title' => $this->t('Display selectable actions as buttons.'), Loading Loading @@ -620,6 +628,10 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe $this->view->style_plugin->options['views_bulk_operations_enabled'] = TRUE; } $form['#attached']['library'][] = 'views_bulk_operations/frontUi'; if ($this->options['ajax_loader']) { $form['#attached']['drupalSettings']['vbo']['ajax_loader'] = TRUE; } // Only add the bulk form options and buttons if // there are results and any actions are available. $action_options = $this->getBulkOptions(); Loading tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ display: batch: false batch_size: 10 form_step: true ajax_loader: true buttons: true action_title: Action clear_on_exposed: true Loading tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml +1 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,7 @@ display: batch: true batch_size: 2 form_step: true ajax_loader: false buttons: false action_title: Action clear_on_exposed: true Loading Loading
config/schema/views_bulk_operations.views.schema.yml +3 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,9 @@ views.field.views_bulk_operations_bulk_form: form_step: type: boolean label: 'Display configuration form on a separate page' ajax_loader: type: boolean label: 'Show throbber on VBO ajax petitions.' buttons: type: boolean label: 'Display action options as buttons' Loading
js/frontUi.js +8 −2 Original line number Diff line number Diff line Loading @@ -128,14 +128,20 @@ var $selectionInfo = this.$selectionInfo; var target_uri = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + 'views-bulk-operations/ajax/' + this.view_id + '/' + this.display_id; var ajaxDrupal = Drupal.ajax({ var ajax_options = { url: target_uri, progress: false, submit: { list: list, op: op } }); }; if (drupalSettings.hasOwnProperty('vbo') && drupalSettings.vbo.hasOwnProperty('ajax_loader') && drupalSettings.vbo.ajax_loader) { ajax_options.progress = { type: 'fullscreen' }; } var ajaxDrupal = Drupal.ajax(ajax_options); ajaxDrupal.original_success = ajaxDrupal.success; ajaxDrupal.success = function (data, status) { Loading
src/Plugin/views/field/ViewsBulkOperationsBulkForm.php +12 −0 Original line number Diff line number Diff line Loading @@ -381,6 +381,7 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe $options['batch'] = ['default' => TRUE]; $options['batch_size'] = ['default' => 10]; $options['form_step'] = ['default' => TRUE]; $options['ajax_loader'] = ['default' => FALSE]; $options['buttons'] = ['default' => FALSE]; $options['clear_on_exposed'] = ['default' => TRUE]; $options['action_title'] = ['default' => $this->t('Action')]; Loading Loading @@ -432,6 +433,13 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe '#access' => FALSE, ]; $form['ajax_loader'] = [ '#type' => 'checkbox', '#title' => $this->t('Show ajax throbber.'), '#description' => $this->t('With this enabled, a throbber will be shown when an ajax petition from VBO is triggered.'), '#default_value' => $this->options['ajax_loader'], ]; $form['buttons'] = [ '#type' => 'checkbox', '#title' => $this->t('Display selectable actions as buttons.'), Loading Loading @@ -620,6 +628,10 @@ class ViewsBulkOperationsBulkForm extends FieldPluginBase implements CacheableDe $this->view->style_plugin->options['views_bulk_operations_enabled'] = TRUE; } $form['#attached']['library'][] = 'views_bulk_operations/frontUi'; if ($this->options['ajax_loader']) { $form['#attached']['drupalSettings']['vbo']['ajax_loader'] = TRUE; } // Only add the bulk form options and buttons if // there are results and any actions are available. $action_options = $this->getBulkOptions(); Loading
tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test.yml +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ display: batch: false batch_size: 10 form_step: true ajax_loader: true buttons: true action_title: Action clear_on_exposed: true Loading
tests/views_bulk_operations_test/config/install/views.view.views_bulk_operations_test_advanced.yml +1 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,7 @@ display: batch: true batch_size: 2 form_step: true ajax_loader: false buttons: false action_title: Action clear_on_exposed: true Loading