editor: Omit text property from block defaults for header and footer
This commit is contained in:
@ -33,6 +33,9 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, App.getConfig().get('blockDefaults.footer'));
|
}, App.getConfig().get('blockDefaults.footer'));
|
||||||
|
},
|
||||||
|
_updateDefaults: function updateDefaults() {
|
||||||
|
App.getConfig().set('blockDefaults.footer', _.omit(this.toJSON(), 'text'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -33,6 +33,9 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, App.getConfig().get('blockDefaults.header'));
|
}, App.getConfig().get('blockDefaults.header'));
|
||||||
|
},
|
||||||
|
_updateDefaults: function updateDefaults() {
|
||||||
|
App.getConfig().set('blockDefaults.header', _.omit(this.toJSON(), 'text'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -125,7 +125,9 @@ define([
|
|||||||
model.trigger('change');
|
model.trigger('change');
|
||||||
expect(stub.callCount).to.equal(1);
|
expect(stub.callCount).to.equal(1);
|
||||||
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.footer');
|
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.footer');
|
||||||
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
|
expect(stub.getCall(0).args[1].type).to.equal(model.toJSON().type);
|
||||||
|
expect(stub.getCall(0).args[1].styles).to.deep.equal(model.toJSON().styles);
|
||||||
|
expect(stub.getCall(0).args[1].text).to.equal(undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -124,7 +124,9 @@ define([
|
|||||||
model.trigger('change');
|
model.trigger('change');
|
||||||
expect(stub.callCount).to.equal(1);
|
expect(stub.callCount).to.equal(1);
|
||||||
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.header');
|
expect(stub.getCall(0).args[0]).to.equal('blockDefaults.header');
|
||||||
expect(stub.getCall(0).args[1]).to.deep.equal(model.toJSON());
|
expect(stub.getCall(0).args[1].type).to.equal(model.toJSON().type);
|
||||||
|
expect(stub.getCall(0).args[1].styles).to.deep.equal(model.toJSON().styles);
|
||||||
|
expect(stub.getCall(0).args[1].text).to.equal(undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user