diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 9d64ab9d5..8a5895eee 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -805,7 +805,7 @@ class LeftAndMain extends Controller implements PermissionProvider { } } - $this->response->addHeader('X-Status', _t('LeftAndMain.SAVED','saved')); + $this->response->addHeader('X-Status', _t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')); } // Update sorting @@ -826,7 +826,7 @@ class LeftAndMain extends Controller implements PermissionProvider { } } - $this->response->addHeader('X-Status', _t('LeftAndMain.SAVED','saved')); + $this->response->addHeader('X-Status', _t('LeftAndMain.REORGANISATIONSUCCESSFUL', 'Reorganised the site tree successfully.')); } return Convert::raw2json($statusUpdates); diff --git a/admin/javascript/LeftAndMain.BatchActions.js b/admin/javascript/LeftAndMain.BatchActions.js index 625c619da..f49114265 100644 --- a/admin/javascript/LeftAndMain.BatchActions.js +++ b/admin/javascript/LeftAndMain.BatchActions.js @@ -43,7 +43,7 @@ tree.bind('check_node.jstree', function(e, data) { self.serializeFromTree(); }); - + $('.cms-tree-view-modes :input[name=view-mode]').bind('click', function(e) { var val = $(e.target).val(), dropdown = self.find(':input[name=Action]'); if(val == 'multiselect') { @@ -53,14 +53,26 @@ tree.removeClass('multiple'); } - // Batch actions only make sense when multiselect is enabled - if(val == 'multiselect') dropdown.removeAttr('disabled').change(); - else dropdown.attr('disabled', 'disabled').change(); + self._updateStateFromViewMode(); }); - + + self._updateStateFromViewMode(); + 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 * @@ -350,4 +362,4 @@ }); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index 2a9d5b543..451e71631 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -489,6 +489,10 @@ jQuery.noConflict(); // Explicitly disable default placeholder if no custom one is defined if(!this.data('placeholder')) this.data('placeholder', ' '); + // We could've gotten stale classes and DOM elements from deferred cache. + this.removeClass('has-chzn chzn-done'); + this.siblings('.chzn-container').remove(); + // Apply Chosen applyChosen(this);