Implement Becs' changes to Posts widget and post rendering

This commit is contained in:
Tautvidas Sipavičius
2015-11-18 14:44:57 +02:00
parent 0eef46db57
commit e62a8c2ec5
10 changed files with 48 additions and 13 deletions

View File

@@ -214,6 +214,7 @@ define([
this.model.set(field, value);
},
onBeforeDestroy: function() {
console.log('Calling close');
MailPoet.Modal.close();
},
});

View File

@@ -241,6 +241,7 @@ define([
insertPosts: function() {
this.model.trigger('insertSelectedPosts');
this.model.destroy();
this.close();
},
});
@@ -332,11 +333,6 @@ define([
},
}).trigger( 'change' );
},
onBeforeDestroy: function() {
base.BlockSettingsView.prototype.onBeforeDestroy.apply(this, arguments);
// Force close select2 if it hasn't closed yet
this.$('.mailpoet_posts_categories_and_tags').select2('close');
},
changeField: function(field, event) {
this.model.set(field, jQuery(event.target).val());
},

View File

@@ -56,7 +56,7 @@ define([
};
Module.getTransformedPosts = function(options) {
return Module._cachedQuery({
return Module._query({
action: 'getTransformedPosts',
options: options,
});