Merge pull request #276 from chrometoasters/bug/uploadfield-template

FIX: Prevent tmpl.js include on ajax request
This commit is contained in:
Robbie Averill 2018-11-14 14:54:51 +02:00 committed by GitHub
commit 4821e9ef74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,9 @@ class GridFieldAddNewInlineButton implements GridField_HTMLProvider, GridField_S
throw new Exception('Inline adding requires the editable columns component');
}
Requirements::javascript(THIRDPARTY_DIR . '/javascript-templates/tmpl.js');
if (!Director::is_ajax()) {
Requirements::javascript(THIRDPARTY_DIR . '/javascript-templates/tmpl.js');
}
GridFieldExtensions::include_requirements();
$data = new ArrayData(array(