Skip to content

Commit

Permalink
FIX for #184: Add loading status to "Versioning" button group when cl…
Browse files Browse the repository at this point in the history
…icking a button inside dropdown.
  • Loading branch information
patricknelson committed Nov 10, 2018
1 parent 71f9653 commit 24977d4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ BetterButtonsGroups:
BetterButton_SaveAndPrev: true
Versioning:
label: Versioning...
icon: arrow-circle-double
buttons:
BetterButton_Rollback: true
BetterButton_Unpublish: true
Expand All @@ -62,4 +63,4 @@ Only:
classexists: EditableOption
---
EditableOption:
better_buttons_versioned_enabled: false
better_buttons_versioned_enabled: false
4 changes: 3 additions & 1 deletion code/extensions/BetterButtonDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,11 @@ protected function instantiateButton($className) {
protected function createButtonGroup($groupName) {
$groupConfig = Config::inst()->get("BetterButtonsGroups", $groupName);
$label = (isset($groupConfig['label'])) ? $groupConfig['label'] : $groupName;
$icon = (isset($groupConfig['icon'])) ? $groupConfig['icon'] : '';
$buttons = (isset($groupConfig['buttons'])) ? $groupConfig['buttons'] : array ();
$button = DropdownFormAction::create(_t('GridFieldBetterButtons.'.$groupName, $label));
foreach($buttons as $b => $bool) {
if ($icon !== '') $button->setAttribute('data-icon', $icon);
foreach($buttons as $b => $bool) {
if($bool) {
if($child = $this->instantiateButton($b)) {
$button->push($child);
Expand Down
7 changes: 6 additions & 1 deletion javascript/dropdown_form_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ $.entwine('ss', function($) {
}

this._super();
},

onmouseup: function() {
$("[data-form-action-dropdown]").addClass('loading');
this._super();
}

});


});
})(jQuery);
})(jQuery);

0 comments on commit 24977d4

Please sign in to comment.