mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #437 from mateusz/sapphire
--- http://open.silverstripe.org/ticket/7304 When the actions dropdown is loaded from deferred cache, the Chosen does not apply because of stale classess and markup.
This commit is contained in:
commit
d5ebdf91b6
@ -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);
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user