Merge pull request #40 from open-sausages/pulls/injector-fix

fix injector on test react form
This commit is contained in:
Damian Mooyman 2017-08-15 12:12:46 +12:00 committed by GitHub
commit 715ee9b1da
2 changed files with 17 additions and 13 deletions

24
client/dist/legacy.js vendored
View File

@ -1,13 +1,15 @@
!function(t){function e(r){if(n[r])return n[r].exports !function(e){function t(r){if(n[r])return n[r].exports
var o=n[r]={exports:{},id:r,loaded:!1} var o=n[r]={exports:{},id:r,loaded:!1}
return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={} return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={}
return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict" return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict"
n(1)},function(t,e,n){"use strict" n(1)},function(e,t,n){"use strict"
function r(t){return t&&t.__esModule?t:{default:t}}var o=n(2),i=r(o),u=n(3),c=r(u),s=n(4),a=r(s),f=n(5),l=n(6),d=r(l),m="TestReactFormBuilder" function r(e){return e&&e.__esModule?e:{default:e}}var o=n(2),i=r(o),u=n(3),c=r(u),s=n(4),a=r(s),f=n(5),l=n(6),d=r(l),m=n(7),p="TestReactFormBuilder",h=(0,m.provideInjector)(d.default)
i.default.entwine("ss",function(t){t(".TestReactFormBuilder").entwine({onmatch:function t(){var e=this i.default.entwine("ss",function(e){e(".TestReactFormBuilder").entwine({onmatch:function e(){var t=this
setTimeout(function(){return e._renderForm()},100),this[0].style.setProperty("overflow-y","scroll","important")},onunmatch:function t(){this._clearForm(),this.css("overflow-y",!1)},open:function t(){this._renderForm() setTimeout(function(){return t._renderForm()},100),this[0].style.setProperty("overflow-y","scroll","important")},onunmatch:function e(){this._clearForm(),this.css("overflow-y",!1)},open:function e(){this._renderForm()
},close:function t(){this._clearForm()},_renderForm:function t(){var e=this,n=window.ss.store,r=n.getState().config.sections.find(function(t){return t.name===m}),o=r.form.TestEditForm.schemaUrl },close:function e(){this._clearForm()},_renderForm:function e(){var t=this,n=window.ss.store,r=n.getState().config.sections.find(function(e){return e.name===p}),o=r.form.TestEditForm.schemaUrl
a.default.render(c.default.createElement(f.Provider,{store:n},c.default.createElement(d.default,{schemaUrl:o,handleSubmit:function t(){return e._handleSubmit.apply(e,arguments)}})),this[0])},_clearForm:function t(){ a.default.render(c.default.createElement(f.Provider,{store:n},c.default.createElement(h,{identifier:"TestReactForm",schemaUrl:o,handleSubmit:function e(){return t._handleSubmit.apply(t,arguments)}})),this[0])
a.default.unmountComponentAtNode(this[0])},_handleSubmit:function t(e,n,r){return e.preventDefault(),r()}}),t(".TestReactFormBuilder .nav-link").entwine({onclick:function t(e){e.preventDefault()}})})},function(t,e){
t.exports=jQuery},function(t,e){t.exports=React},function(t,e){t.exports=ReactDom},function(t,e){t.exports=ReactRedux},function(t,e){t.exports=FormBuilderLoader}]) },_clearForm:function e(){a.default.unmountComponentAtNode(this[0])},_handleSubmit:function e(t,n,r){return t.preventDefault(),r()}}),e(".TestReactFormBuilder .nav-link").entwine({onclick:function e(t){
t.preventDefault()}})})},function(e,t){e.exports=jQuery},function(e,t){e.exports=React},function(e,t){e.exports=ReactDom},function(e,t){e.exports=ReactRedux},function(e,t){e.exports=FormBuilderLoader},function(e,t){
e.exports=Injector}])

View File

@ -3,9 +3,10 @@ import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import { Provider } from 'react-redux'; import { Provider } from 'react-redux';
import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader'; import FormBuilderLoader from 'containers/FormBuilderLoader/FormBuilderLoader';
import { provideInjector } from 'lib/Injector';
const sectionConfigKey = 'TestReactFormBuilder'; const sectionConfigKey = 'TestReactFormBuilder';
const InjectedFormBuilderLoader = provideInjector(FormBuilderLoader);
jQuery.entwine('ss', ($) => { jQuery.entwine('ss', ($) => {
/** /**
* Kick off Test React FormBuilder admin section. * Kick off Test React FormBuilder admin section.
@ -39,7 +40,8 @@ jQuery.entwine('ss', ($) => {
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<FormBuilderLoader <InjectedFormBuilderLoader
identifier="TestReactForm"
schemaUrl={schemaUrl} schemaUrl={schemaUrl}
handleSubmit={(...args) => this._handleSubmit(...args)} handleSubmit={(...args) => this._handleSubmit(...args)}
/> />