fix initial highlighting in hidden editor
This commit is contained in:
parent
fa13f377e1
commit
2852638c45
2 changed files with 8 additions and 5 deletions
|
|
@ -64,8 +64,6 @@ $(function() {
|
||||||
|
|
||||||
tabs.find(tab_a_selector).click(function(e) {
|
tabs.find(tab_a_selector).click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
embedded_editor.resize();
|
|
||||||
editor.resize();
|
|
||||||
if ($(this).attr("href") === "/") {
|
if ($(this).attr("href") === "/") {
|
||||||
window.location = "http://ace.ajax.org";
|
window.location = "http://ace.ajax.org";
|
||||||
return;
|
return;
|
||||||
|
|
@ -102,6 +100,8 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).tab("show");
|
$(this).tab("show");
|
||||||
|
embedded_editor.resize();
|
||||||
|
editor.resize();
|
||||||
|
|
||||||
var state = {};
|
var state = {};
|
||||||
state.nav = $(this).attr("href").substr(1);
|
state.nav = $(this).attr("href").substr(1);
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$textLayer.checkForSizeChanges();
|
this.$textLayer.checkForSizeChanges();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$changes = 0;
|
||||||
/**
|
/**
|
||||||
* [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}
|
* [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}
|
||||||
* @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed
|
* @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed
|
||||||
|
|
@ -280,7 +281,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
this.onResize = function(force, gutterWidth, width, height) {
|
this.onResize = function(force, gutterWidth, width, height) {
|
||||||
var changes = 0;
|
var changes = this.$changes || 0;
|
||||||
var size = this.$size;
|
var size = this.$size;
|
||||||
|
|
||||||
if (this.resizing > 2)
|
if (this.resizing > 2)
|
||||||
|
|
@ -644,8 +645,10 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$renderChanges = function(changes, force) {
|
this.$renderChanges = function(changes, force) {
|
||||||
if (!force && (!changes || !this.session || !this.container.offsetWidth))
|
if (!force && (!changes || !this.session || !this.container.offsetWidth)) {
|
||||||
return;
|
this.$changes = changes;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._signal("beforeRender");
|
this._signal("beforeRender");
|
||||||
// text, scrolling and resize changes can cause the view port size to change
|
// text, scrolling and resize changes can cause the view port size to change
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue