Merge pull request #5590 from silverstripe-terraformers/fixes/boot-namespace

Add namespace for appBoot, and fix syntax error in GridField
This commit is contained in:
Hamish Friedlander 2016-05-25 16:50:42 +12:00
commit c4929e8ce9
2 changed files with 6 additions and 4 deletions

View File

@ -45,4 +45,6 @@ function appBoot() {
// Entwine hooks are being used to set up the <Provider>.
// `window.onload` happens AFTER these Entwine hooks which means
// the store is undefined when the <Provider> is constructed.
$('body').entwine({ onadd: () => appBoot() });
$.entwine('ss', () => {
$('body').entwine({ onadd: () => appBoot() });
});

View File

@ -11,6 +11,8 @@ import GridFieldAction from './GridFieldAction';
import FormConstants from 'components/Form/FormConstants';
import * as actions from 'state/records/RecordsActions';
const NotYetLoaded = {};
/**
* The component acts as a container for a grid field,
* with smarts around data retrieval from external sources.
@ -161,13 +163,11 @@ GridField.propTypes = {
}),
};
const NotYetLoaded = {};
function mapStateToProps(state, ownProps) {
const recordType = ownProps.data ? ownProps.data.recordType : null;
return {
config: state.config,
records: recordType && state.records[recordType] ? state.records[recordType] : NotYetLoaded
records: recordType && state.records[recordType] ? state.records[recordType] : NotYetLoaded,
};
}