Browse Source

Always resize instead of refresh. Fixes #229

dev/git-series/gccdum
Matt Godbolt 6 years ago
parent
commit
54ffd96864
  1. 8
      static/compiler.js
  2. 8
      static/editor.js

8
static/compiler.js

@ -113,7 +113,7 @@ define(function (require) {
self.eventHub.emit('compilerClose', self.id);
}, this);
container.on('resize', this.resize, this);
container.on('shown', this.refresh, this);
container.on('shown', this.resize, this);
container.on('open', function () {
self.eventHub.emit('compilerOpen', self.id);
self.updateFontScale();
@ -154,10 +154,6 @@ define(function (require) {
this.saveState();
}
Compiler.prototype.refresh = function () {
this.outputEditor.refresh();
};
// TODO: need to call resize if either .top-bar or .bottom-bar resizes, which needs some work.
// Issue manifests if you make a window where one compiler is small enough that the buttons spill onto two lines:
// reload the page and the bottom-bar is off the bottom until you scroll a tiny bit.
@ -165,7 +161,7 @@ define(function (require) {
var topBarHeight = this.domRoot.find(".top-bar").outerHeight(true);
var bottomBarHeight = this.domRoot.find(".bottom-bar").outerHeight(true);
this.outputEditor.setSize(this.domRoot.width(), this.domRoot.height() - topBarHeight - bottomBarHeight);
this.refresh();
this.outputEditor.refresh();
};
// Gets the filters that will actually be used (accounting for issues with binary

8
static/editor.js

@ -122,14 +122,10 @@ define(function (require) {
this.debouncedEmitChange();
}, this));
function refresh() {
self.editor.refresh();
}
function resize() {
var topBarHeight = self.domRoot.find(".top-bar").outerHeight(true);
self.editor.setSize(self.domRoot.width(), self.domRoot.height() - topBarHeight);
refresh();
self.editor.refresh();
}
this.domRoot.find('.load-save').click(_.bind(function () {
@ -141,7 +137,7 @@ define(function (require) {
}, this));
container.on('resize', resize);
container.on('shown', refresh);
container.on('shown', resize);
container.on('open', function () {
self.eventHub.emit('editorOpen', self.id);
});

Loading…
Cancel
Save