Skip to content

Commit

Permalink
Releases v1.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pandao committed May 9, 2015
1 parent 200fb88 commit 7e5a1e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,4 +452,5 @@ v1.2.0 主要更新:
####v1.4.4

- 修复 Bug [#81](https://github.com/pandao/editor.md/issues/81),即不支持 `:+1:` 的问题;
- 修复 Bug [#85](https://github.com/pandao/editor.md/issues/85),即图片上传返回结果不支持 `Content-Type=application/json` 的问题;
- 修复 Bug [#85](https://github.com/pandao/editor.md/issues/85),即图片上传返回结果不支持 `Content-Type=application/json` 的问题;
- 修复图片上传无法显示 loading 的问题;
15 changes: 8 additions & 7 deletions plugins/image-dialog/image-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @file image-dialog.js
* @author pandao
* @version 1.3.1
* @version 1.3.2
* @updateTime 2015-05-09
* {@link https://github.com/pandao/editor.md}
* @license MIT
Expand Down Expand Up @@ -31,6 +31,11 @@

cm.focus();

var loading = function(show) {
var _loading = dialog.find("." + classPrefix + "dialog-mask");
_loading[(show) ? "show" : "hide"]();
};

if (editor.find("." + dialogName).length < 1)
{
var guid = (new Date).getTime();
Expand Down Expand Up @@ -136,18 +141,14 @@
}
else
{
if (typeof (dialog.loading) == "function") {
dialog.loading(true);
}
loading(true);

var submitHandler = function() {

var uploadIframe = document.getElementById(iframeName);

uploadIframe.onload = function() {
if (typeof (dialog.loading) == "function") {
dialog.loading(false);
}
loading(false);

var json = uploadIframe.contentWindow.document.body.innerText;
json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")");
Expand Down

0 comments on commit 7e5a1e9

Please sign in to comment.