mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 00:45:33 +08:00
FIX: cannot paste text in composer
This commit is contained in:
parent
f6ec8e01ec
commit
0cb8ea1426
@ -285,11 +285,13 @@ Discourse.ComposerView = Discourse.View.extend({
|
|||||||
// can only upload one image at a time
|
// can only upload one image at a time
|
||||||
if (data.files.length > 1) {
|
if (data.files.length > 1) {
|
||||||
bootbox.alert(Em.String.i18n('post.errors.upload_too_many_images'));
|
bootbox.alert(Em.String.i18n('post.errors.upload_too_many_images'));
|
||||||
|
return false;
|
||||||
} else if (data.files.length > 0) {
|
} else if (data.files.length > 0) {
|
||||||
// check image size
|
// check image size
|
||||||
var fileSizeInKB = data.files[0].size / 1024;
|
var fileSizeInKB = data.files[0].size / 1024;
|
||||||
if (fileSizeInKB > Discourse.SiteSettings.max_upload_size_kb) {
|
if (fileSizeInKB > Discourse.SiteSettings.max_upload_size_kb) {
|
||||||
bootbox.alert(Em.String.i18n('post.errors.upload_too_large', { max_size_kb: Discourse.SiteSettings.max_upload_size_kb }));
|
bootbox.alert(Em.String.i18n('post.errors.upload_too_large', { max_size_kb: Discourse.SiteSettings.max_upload_size_kb }));
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// reset upload status
|
// reset upload status
|
||||||
_this.setProperties({
|
_this.setProperties({
|
||||||
@ -299,7 +301,8 @@ Discourse.ComposerView = Discourse.View.extend({
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
// we need to return true here, otherwise it prevents the default paste behavior
|
||||||
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// paste
|
// paste
|
||||||
|
Loading…
x
Reference in New Issue
Block a user