From 91a8fdf871e7cbba91c5c6b1ed6c6e6dbd602292 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sun, 2 Nov 2014 10:58:13 +0800 Subject: [PATCH] . --- conf/wide.json | 2 +- static/js/wide.js | 25 +++++++++++-------------- static/user/admin/style.css | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/conf/wide.json b/conf/wide.json index d3068a2..3ac83f7 100644 --- a/conf/wide.json +++ b/conf/wide.json @@ -20,7 +20,7 @@ "Locale": "en_US", "GoFormat": "gofmt", "FontFamily": "Helvetica", - "FontSize": "inherit", + "FontSize": "13px", "Editor": { "FontFamily": "Consolas, 'Courier New', monospace", "FontSize": "inherit" diff --git a/static/js/wide.js b/static/js/wide.js index 2f4fe78..f00dfe3 100644 --- a/static/js/wide.js +++ b/static/js/wide.js @@ -714,17 +714,14 @@ var wide = { switch (mode) { case "text/x-go": $.ajax({ + async: false, // 同步执行 type: 'POST', url: '/go/fmt', data: JSON.stringify(request), dataType: "json", success: function (data) { if (data.succ) { - curEditor.setValue(data.code); - curEditor.setCursor(cursor); - curEditor.scrollTo(null, scrollInfo.top); - - return; + formatted = data.code; } } }); @@ -750,16 +747,16 @@ var wide = { curEditor.scrollTo(null, scrollInfo.top); wide._save(); - } - // 清除未保存状态 - curEditor.doc.markClean(); - $(".edit-panel .tabs > div").each(function () { - var $span = $(this).find("span:eq(0)"); - if ($span.attr("title") === path) { - $span.removeClass("changed"); - } - }); + // 清除未保存状态 + curEditor.doc.markClean(); + $(".edit-panel .tabs > div").each(function () { + var $span = $(this).find("span:eq(0)"); + if ($span.attr("title") === path) { + $span.removeClass("changed"); + } + }); + } }, openAbout: function () { $("#dialogAbout").dialog("open"); diff --git a/static/user/admin/style.css b/static/user/admin/style.css index c42b9ca..e07c2bb 100644 --- a/static/user/admin/style.css +++ b/static/user/admin/style.css @@ -2,7 +2,7 @@ body, input, button { font-family: Helvetica; - font-size: inherit; + font-size: 13px; } .edit-exprinfo,