resize editor only when tab is fully shown
This commit is contained in:
parent
73d8eb5898
commit
22de40bf6a
1 changed files with 11 additions and 7 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue