修正替换文件的问题

This commit is contained in:
joyqi
2013-12-06 20:51:13 +08:00
parent 6db990f7a4
commit be5f4f6e8b
+5 -2
View File
@@ -83,8 +83,11 @@ $(document).ready(function() {
}
function fileUploadComplete (id, url, data) {
var img = $('.typecho-attachment-photo').get(0);
img.src = '<?php $attachment->attachment->url(); ?>?' + Math.random();
var img = $('.typecho-attachment-photo');
if (img.length > 0) {
img.get(0).src = '<?php $attachment->attachment->url(); ?>?' + Math.random();
}
$('#' + id).html('<?php _e('文件 %s 已经替换'); ?>'.replace('%s', data.title))
.effect('highlight', 1000, function () {