From ce63d7b8c366679061eff41ee5e0abb915952234 Mon Sep 17 00:00:00 2001 From: fen Date: Tue, 26 Nov 2013 17:24:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/css/style.css | 8 ++++++-- admin/editor-js.php | 7 +++++++ admin/scss/components/_editor.scss | 12 +++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/admin/css/style.css b/admin/css/style.css index 7281cedf..f2ffbfc9 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -1217,6 +1217,9 @@ a.operate-reply { .wmd-hidetab { display: none; } +.wmd-visualhide { + visibility: hidden; } + /* 对话框 */ .wmd-prompt-background { background-color: #000; } @@ -1246,9 +1249,8 @@ a.operate-reply { background: #FFF; margin: 1em 0; padding: 0 15px; - border: 1px solid #D9D9D6; word-wrap: break-word; - overflow: scroll; + overflow: auto; -webkit-border-radius: 2px; -moz-border-radius: 2px; -ms-border-radius: 2px; @@ -1339,6 +1341,8 @@ a.operate-reply { display: none; } .fullscreen .wmd-hidetab { display: block; } +.fullscreen .wmd-visualhide { + visibility: visible; } /** * Jquery Timepicker diff --git a/admin/editor-js.php b/admin/editor-js.php index 15739293..cb83de7d 100644 --- a/admin/editor-js.php +++ b/admin/editor-js.php @@ -210,6 +210,13 @@ $(document).ready(function () { var selected_tab = $(this).attr("href"), selected_el = $(selected_tab).removeClass("wmd-hidetab"); + // 预览时隐藏编辑器按钮 + if (selected_tab == "#wmd-preview") { + $("#wmd-button-row").addClass("wmd-visualhide"); + } else { + $("#wmd-button-row").removeClass("wmd-visualhide"); + } + // 预览和编辑窗口高度一致 $("#wmd-preview").outerHeight($("#wmd-editarea").innerHeight()); diff --git a/admin/scss/components/_editor.scss b/admin/scss/components/_editor.scss index 5204b336..1dd5396f 100644 --- a/admin/scss/components/_editor.scss +++ b/admin/scss/components/_editor.scss @@ -63,7 +63,11 @@ // 控制被隐藏的 tab,全屏时显示 .wmd-hidetab { display: none; -} +} +// 隐藏编辑器,但占位 +.wmd-visualhide { + visibility: hidden; +} /* 对话框 */ .wmd-prompt-background { @@ -94,9 +98,8 @@ background: #FFF; margin: 1em 0; padding: 0 15px; - border: 1px solid #D9D9D6; word-wrap: break-word; - overflow: scroll; + overflow: auto; @include border-radius(2px); img { max-width: 100%; } code, pre { @@ -188,4 +191,7 @@ .message, #upload-panel { display: none; } .wmd-hidetab { display: block; } + .wmd-visualhide { + visibility: visible; + } } \ No newline at end of file