mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Removed GridField->requireDefaultCSS() idiom, not used elsewhere (or used for JS in the same class), should be handled through Requirements class instead
This commit is contained in:
parent
3866f561f5
commit
c422e06b60
@ -144,13 +144,6 @@ class GridField extends FormField {
|
||||
$this->components = $config->getComponents();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Require the default css styling
|
||||
*/
|
||||
protected function requireDefaultCSS() {
|
||||
Requirements::css('sapphire/css/GridField.css');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DisplayFields
|
||||
@ -713,6 +706,8 @@ class GridField_Action extends FormAction {
|
||||
* @return string HTML tag
|
||||
*/
|
||||
public function Field() {
|
||||
Requirements::css('sapphire/css/GridField.css');
|
||||
|
||||
Requirements::javascript(SAPPHIRE_DIR.'/thirdparty/jquery/jquery.js');
|
||||
Requirements::javascript(SAPPHIRE_DIR.'/thirdparty/json-js/json2.js');
|
||||
Requirements::javascript(SAPPHIRE_DIR.'/thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
|
||||
|
@ -3,13 +3,10 @@ class GridFieldtest extends SapphireTest {
|
||||
|
||||
/**
|
||||
* @covers GridField::__construct
|
||||
* @covers GridFIeld::requireDefaultCSS
|
||||
*/
|
||||
public function testGridField() {
|
||||
$obj = new GridField('testfield', 'testfield');
|
||||
$this->assertTrue($obj instanceof GridField, 'Test that the constructor arguments are valid');
|
||||
$css = Requirements::backend()->get_css();
|
||||
$this->assertTrue(isset($css['sapphire/css/GridField.css']), 'GridField.css should have been aquired');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user