mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04:00
Merge pull request #619 from ZogStriP/fix-cannot-paste-text-in-composer
FIX: cannot paste text in composer
This commit is contained in:
commit
3376ea5615
1 changed files with 4 additions and 1 deletions
|
@ -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…
Reference in a new issue