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:
Ingo Schommer 2012-02-09 11:15:31 +01:00
parent 3866f561f5
commit c422e06b60
2 changed files with 2 additions and 10 deletions

View File

@ -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');

View File

@ -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');
}
/**