- fixed selection field JSX
- fixed bulk actions (added filter function)
- added getPublished/getTrashed static methods on Model
- fixed step 3 of newsletter process
- updated save/get methods of all listing-able models to conform with the new norm
This commit is contained in:
Jonathan Labreuille
2015-11-09 13:26:33 +01:00
parent 0199e2c7e1
commit e9110680ee
12 changed files with 120 additions and 41 deletions

View File

@ -54,6 +54,11 @@ function(
loadCachedItems: function() {
if(typeof(window['mailpoet_'+this.props.field.endpoint]) !== 'undefined') {
var items = window['mailpoet_'+this.props.field.endpoint];
if(this.props.field['filter'] !== undefined) {
items = items.filter(this.props.field.filter);
}
this.setState({
items: items
});
@ -76,7 +81,7 @@ function(
return true;
},
render: function() {
if(this.state.items.length === 0) {
if((this.props.item !== undefined && this.props.item.id === undefined)) {
return false;
} else {
var options = this.state.items.map(function(item, index) {