mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fixing based on Spencers comments
This commit is contained in:
parent
40234e8e41
commit
cdad7724bc
2 changed files with 10 additions and 6 deletions
|
@ -64,12 +64,8 @@ export default function VisFactory(Private) {
|
|||
uiState.on('change', this._uiStateChangeHandler = () => this.render(this.data, this.uiState));
|
||||
}
|
||||
|
||||
this.resizeChecker.stopSchedule();
|
||||
this.handler = handlerTypes[chartType](this) || handlerTypes.column(this);
|
||||
this._runOnHandler('render');
|
||||
this.resizeChecker.saveSize();
|
||||
this.resizeChecker.saveDirty(false);
|
||||
this.resizeChecker.continueSchedule();
|
||||
this._runWithoutResizeChecker('render');
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -90,6 +86,14 @@ export default function VisFactory(Private) {
|
|||
}
|
||||
};
|
||||
|
||||
_runWithoutResizeChecker(method) {
|
||||
this.resizeChecker.stopSchedule();
|
||||
this._runOnHandler(method);
|
||||
this.resizeChecker.saveSize();
|
||||
this.resizeChecker.saveDirty(false);
|
||||
this.resizeChecker.continueSchedule();
|
||||
}
|
||||
|
||||
_runOnHandler(method) {
|
||||
try {
|
||||
this.handler[method]();
|
||||
|
|
|
@ -134,7 +134,7 @@ describe('renderbot', function exportWrapper() {
|
|||
let buildStub = sinon.stub(renderbot, 'buildChartData', _.constant(football));
|
||||
let renderStub = sinon.stub(renderbot.vislibVis, 'render');
|
||||
|
||||
renderbot.render('flat data', persistedState).then(() => {
|
||||
return renderbot.render('flat data', persistedState).then(() => {
|
||||
expect(renderStub.callCount).to.be(1);
|
||||
expect(buildStub.callCount).to.be(1);
|
||||
expect(renderStub.firstCall.args[0]).to.be(football);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue