From e3e8c149a0eb166cf7a74cf7f96e179a5b854c73 Mon Sep 17 00:00:00 2001 From: joyqi Date: Sun, 20 Oct 2013 13:50:39 +0800 Subject: [PATCH] fixed #11 --- admin/file-upload-js.php | 10 +++++----- admin/write-js.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/file-upload-js.php b/admin/file-upload-js.php index 9d3e29ba..c45cbc0a 100644 --- a/admin/file-upload-js.php +++ b/admin/file-upload-js.php @@ -160,11 +160,6 @@ $(document).ready(function() { } }); - $('#file-list li').each(function () { - attachInsertEvent(this); - attachDeleteEvent(this); - }); - function attachInsertEvent (el) { $('.insert', el).click(function () { var t = $(this), p = t.parents('li'); @@ -190,6 +185,11 @@ $(document).ready(function() { return false; }); } + + $('#file-list li').each(function () { + attachInsertEvent(this); + attachDeleteEvent(this); + }); }); diff --git a/admin/write-js.php b/admin/write-js.php index 19f9e199..cd80b27c 100644 --- a/admin/write-js.php +++ b/admin/write-js.php @@ -249,7 +249,7 @@ $(document).ready(function () { editor.run(); var imageButton = $('#wmd-image-button'), - linkButton = $('#wmd-image-button'); + linkButton = $('#wmd-link-button'); Typecho.insertFileToEditor = function (file, url, isImage) { var button = isImage ? imageButton : linkButton;