mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Update the batch action select state also on load (os7304)
This approach should cover more situations than the previous one. It will owrk regardless of the initial state in the HTML (which can be loaded from deferred cache).
This commit is contained in:
parent
b28a625f0b
commit
905115b4db
@ -53,14 +53,26 @@
|
|||||||
tree.removeClass('multiple');
|
tree.removeClass('multiple');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Batch actions only make sense when multiselect is enabled
|
self._updateStateFromViewMode();
|
||||||
if(val == 'multiselect') dropdown.removeAttr('disabled').change();
|
|
||||||
else dropdown.attr('disabled', 'disabled').change();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self._updateStateFromViewMode();
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the select box state according to the current view mode.
|
||||||
|
*/
|
||||||
|
_updateStateFromViewMode: function() {
|
||||||
|
var viewMode = $('.cms-tree-view-modes :input[name=view-mode]:checked').val();
|
||||||
|
var dropdown = this.find(':input[name=Action]');
|
||||||
|
|
||||||
|
// Batch actions only make sense when multiselect is enabled.
|
||||||
|
if(viewMode == 'multiselect') dropdown.removeAttr('disabled').trigger("liszt:updated");
|
||||||
|
else dropdown.attr('disabled', true).trigger("liszt:updated");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: register
|
* Function: register
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user