diff --git a/CNAME b/CNAME new file mode 100644 index 00000000..f43ae7a9 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +ace.ajax.org diff --git a/doc/site/js/main.js b/doc/site/js/main.js index f4d2f951..ed9fbff4 100644 --- a/doc/site/js/main.js +++ b/doc/site/js/main.js @@ -75,16 +75,16 @@ $(function() { $('.menu-item a').click(magicClickInterceptor); $('a.argument').click(magicClickInterceptor); - $('a.external').click(function(e) { + $('a.external').click(function(e) { e.preventDefault(); }); - var tabs = $("#tabnav"), - tab_a_selector = "a"; + var tabs = $("#tabnav"), + tab_a_selector = "a"; - var firstLoad = true; + var firstLoad = true; - tabs.find(tab_a_selector).click(function(e) { + tabs.find(tab_a_selector).click(function(e) { e.preventDefault(); if ($(this).attr("href") === "/") { window.location = "http://ace.ajax.org"; @@ -122,14 +122,18 @@ $(function() { } $(this).tab("show"); - embedded_editor.resize(); - editor.resize(); var state = {}; state.nav = $(this).attr("href").substr(1); $.bbq.pushState(state); }); + $('#tabnav a[data-toggle="tab"]').on('shown', function (e) { + $(".tab-content .tab-pane.active .ace_editor").each(function(i, el){ + el.env.onResize(); + }); + }); + $(window).on("hashchange", function(e) { _gaq.push(['_trackPageview',location.pathname + location.search + location.hash]); tabs.each(function() { diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 24e0ea05..79202931 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -176,10 +176,15 @@ var TextInput = function(parentNode, host) { if (inComposition && (!text.value || keytable[e.keyCode])) setTimeout(onCompositionEnd, 0); if ((text.value.charCodeAt(0)||0) < 129) { - return; + return syncProperty.call(); } inComposition ? onCompositionUpdate() : onCompositionStart(); }); + // when user presses backspace after focusing the editor + // propertychange isn't called for the next character + event.addListener(text, "keydown", function (e) { + syncProperty.schedule(50); + }); } var onSelect = function(e) { diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 1ba49cb3..ce7d4e00 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -335,7 +335,7 @@ var VirtualRenderer = function(container, theme) { // }.bind(this), 500) - if (!this.$size.scrollerHeight) + if (!this.$size.scrollerHeight || (!width && !height)) return this.resizing = 0; if (force) @@ -344,7 +344,7 @@ var VirtualRenderer = function(container, theme) { if (force) this.$renderChanges(changes, true); else - this.$loop.schedule(changes); + this.$loop.schedule(changes || this.$changes); if (this.resizing) this.resizing = 0; @@ -730,14 +730,14 @@ var VirtualRenderer = function(container, theme) { }; this.$renderChanges = function(changes, force) { - if ((!this.session || !this.container.offsetWidth) || (!changes && !force)) { - this.$changes |= changes; - return; - } if (this.$changes) { changes |= this.$changes; this.$changes = 0; } + if ((!this.session || !this.container.offsetWidth) || (!changes && !force)) { + this.$changes |= changes; + return; + } if (!this.$size.width) return this.onResize(true);