From 19be0990da7f383496521f30a0ea7ab89b97fbb9 Mon Sep 17 00:00:00 2001 From: lealife Date: Sat, 28 Nov 2015 21:31:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E9=94=80=E5=90=8E=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/app/page.js | 6 +++++- public/js/common.js | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/js/app/page.js b/public/js/app/page.js index 05ac2c1..683839b 100644 --- a/public/js/app/page.js +++ b/public/js/app/page.js @@ -95,6 +95,7 @@ editorMode.prototype.normalMode = function() { $("#note").css("left", UserInfo.NoteListWidth); this.isWritingMode = false; + this.resizeEditor(); }; editorMode.prototype.writtingMode = function() { @@ -307,7 +308,7 @@ var Resize = { clearInterval(self.resizeMDInterval); self.resizeMDInterval = setTimeout(function () { - MD.aceEditor && MD.aceEditor.resize(); + MD.resize && MD.resize(); }, 50); } }, @@ -574,6 +575,9 @@ function initEditor() { // 刷新时保存 参考autosave插件 window.onbeforeunload = function(e) { + if (LEA.isLogout) { + return; + } Note.curChangedSaveIt(true); } diff --git a/public/js/common.js b/public/js/common.js index 8b7e553..98af0e1 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -212,7 +212,7 @@ function _ajaxCallback(ret, successFunc, failureFunc) { // 是否是NOTELOGIN if(ret && typeof ret == "object") { if(ret.Msg == "NOTLOGIN") { - alert("你还没有登录, 请先登录!"); + alert(getMsg("Please sign in firstly!")); return; } } @@ -861,6 +861,9 @@ function setCookie(c_name, value, expiredays) { document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + 'path=/note'; } function logout() { + Note.curChangedSaveIt(true); + LEA.isLogout = true; + setCookie("LEANOTE_SESSION", '', -1); location.href = UrlPrefix + "/logout?id=1"; }