From fd06a8da5f33892fce707600ecd9167540e2efcf Mon Sep 17 00:00:00 2001 From: Hayden Shaw Date: Wed, 19 Dec 2018 14:40:17 +1300 Subject: [PATCH 1/2] Add css and js to left and main * Add yaml file * Remove requirement calls from field constructors --- _config/config.yml | 9 +++++++++ src/StringTagField.php | 3 --- src/TagField.php | 3 --- 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 _config/config.yml diff --git a/_config/config.yml b/_config/config.yml new file mode 100644 index 0000000..a026625 --- /dev/null +++ b/_config/config.yml @@ -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' diff --git a/src/StringTagField.php b/src/StringTagField.php index af907d3..06dd1b1 100644 --- a/src/StringTagField.php +++ b/src/StringTagField.php @@ -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 diff --git a/src/TagField.php b/src/TagField.php index 740c934..5b74bc5 100644 --- a/src/TagField.php +++ b/src/TagField.php @@ -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); From 8a9241c522133dc4eb8fb0fac302bfa6f7217ca4 Mon Sep 17 00:00:00 2001 From: Guy Marriott Date: Wed, 19 Dec 2018 21:55:03 +1300 Subject: [PATCH 2/2] FIX Make config namespace more specific --- _config/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config/config.yml b/_config/config.yml index a026625..cf80fe7 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -1,5 +1,5 @@ --- -Name: tagfield +Name: tagfieldrequirements --- SilverStripe\Admin\LeftAndMain: