Fix Select2 integration in Form component
This commit is contained in:
@ -14,10 +14,12 @@ function(
|
||||
return {
|
||||
items: [],
|
||||
initialized: false
|
||||
}
|
||||
};
|
||||
},
|
||||
componentWillMount: function() {
|
||||
this.loadCachedItems();
|
||||
},
|
||||
componentDidMount: function() {
|
||||
this.loadCachedItems();
|
||||
this.setupSelect2();
|
||||
},
|
||||
componentDidUpdate: function(prevProps, prevState) {
|
||||
@ -70,11 +72,6 @@ function(
|
||||
|
||||
select2.on('change', this.handleChange);
|
||||
|
||||
select2.select2(
|
||||
'val',
|
||||
this.getSelectedValues()
|
||||
);
|
||||
|
||||
this.setState({ initialized: true });
|
||||
},
|
||||
getSelectedValues: function() {
|
||||
|
@ -28,7 +28,6 @@ define(
|
||||
type: 'standard',
|
||||
}
|
||||
}).done(function(response) {
|
||||
console.log(response);
|
||||
if(response.result && response.newsletter.id) {
|
||||
this.showTemplateSelection(response.newsletter.id);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user