Add css and js to left and main

* Add yaml file
* Remove requirement calls from field constructors
This commit is contained in:
Hayden Shaw 2018-12-19 14:40:17 +13:00
parent feff8b52f1
commit fd06a8da5f
3 changed files with 9 additions and 6 deletions

9
_config/config.yml Normal file
View File

@ -0,0 +1,9 @@
---
Name: tagfield
---
SilverStripe\Admin\LeftAndMain:
extra_requirements_javascript:
- 'silverstripe/tagfield:client/dist/js/bundle.js'
extra_requirements_css:
- 'silverstripe/tagfield:client/dist/styles/bundle.css'

View File

@ -144,9 +144,6 @@ class StringTagField extends DropdownField
public function Field($properties = [])
{
Requirements::css('silverstripe/tagfield:client/dist/styles/bundle.css');
Requirements::javascript('silverstripe/tagfield:client/dist/js/bundle.js');
$this->addExtraClass('ss-tag-field');
return $this

View File

@ -200,9 +200,6 @@ class TagField extends DropdownField
*/
public function Field($properties = [])
{
Requirements::css('silverstripe/tagfield:client/dist/styles/bundle.css');
Requirements::javascript('silverstripe/tagfield:client/dist/js/bundle.js');
$this->addExtraClass('ss-tag-field');
return $this->customise($properties)->renderWith(self::class);