mirror of
https://github.com/discourse/discourse.git
synced 2025-02-17 16:55:08 +00:00
FIX: hides upload link on mobile
This commit is contained in:
parent
55f47491a4
commit
4c19088084
@ -13,7 +13,6 @@ import { tinyAvatar,
|
|||||||
displayErrorForUpload,
|
displayErrorForUpload,
|
||||||
getUploadMarkdown,
|
getUploadMarkdown,
|
||||||
validateUploadedFiles,
|
validateUploadedFiles,
|
||||||
authorizesOneOrMoreExtensions,
|
|
||||||
authorizesOneOrMoreImageExtensions,
|
authorizesOneOrMoreImageExtensions,
|
||||||
formatUsername,
|
formatUsername,
|
||||||
clipboardData
|
clipboardData
|
||||||
@ -670,7 +669,7 @@ export default Ember.Component.extend({
|
|||||||
unshift: true
|
unshift: true
|
||||||
});
|
});
|
||||||
|
|
||||||
if (authorizesOneOrMoreExtensions()) {
|
if (this.get('allowUpload')) {
|
||||||
toolbar.addButton({
|
toolbar.addButton({
|
||||||
id: 'upload',
|
id: 'upload',
|
||||||
group: 'insertions',
|
group: 'insertions',
|
||||||
|
@ -5,7 +5,7 @@ import Composer from 'discourse/models/composer';
|
|||||||
import { default as computed, observes, on } from 'ember-addons/ember-computed-decorators';
|
import { default as computed, observes, on } from 'ember-addons/ember-computed-decorators';
|
||||||
import InputValidation from 'discourse/models/input-validation';
|
import InputValidation from 'discourse/models/input-validation';
|
||||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||||
import { escapeExpression } from 'discourse/lib/utilities';
|
import { escapeExpression, authorizesOneOrMoreExtensions } from 'discourse/lib/utilities';
|
||||||
import { emojiUnescape } from 'discourse/lib/text';
|
import { emojiUnescape } from 'discourse/lib/text';
|
||||||
import { shortDate } from 'discourse/lib/formatter';
|
import { shortDate } from 'discourse/lib/formatter';
|
||||||
|
|
||||||
@ -70,6 +70,7 @@ export default Ember.Controller.extend({
|
|||||||
scopedCategoryId: null,
|
scopedCategoryId: null,
|
||||||
lastValidatedAt: null,
|
lastValidatedAt: null,
|
||||||
isUploading: false,
|
isUploading: false,
|
||||||
|
allowUpload: false,
|
||||||
topic: null,
|
topic: null,
|
||||||
linkLookup: null,
|
linkLookup: null,
|
||||||
showPreview: true,
|
showPreview: true,
|
||||||
@ -223,6 +224,11 @@ export default Ember.Controller.extend({
|
|||||||
return emojiUnescape(escapeExpression(topic.get('title')));
|
return emojiUnescape(escapeExpression(topic.get('title')));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed
|
||||||
|
allowUpload() {
|
||||||
|
return authorizesOneOrMoreExtensions();
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
cancelUpload() {
|
cancelUpload() {
|
||||||
this.set('model.uploadCancelled', true);
|
this.set('model.uploadCancelled', true);
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
popupMenuOptions=popupMenuOptions
|
popupMenuOptions=popupMenuOptions
|
||||||
draftStatus=model.draftStatus
|
draftStatus=model.draftStatus
|
||||||
isUploading=isUploading
|
isUploading=isUploading
|
||||||
|
allowUpload=allowUpload
|
||||||
isCancellable=isCancellable
|
isCancellable=isCancellable
|
||||||
uploadProgress=uploadProgress
|
uploadProgress=uploadProgress
|
||||||
groupsMentioned="groupsMentioned"
|
groupsMentioned="groupsMentioned"
|
||||||
@ -131,7 +132,9 @@
|
|||||||
|
|
||||||
<div class="composer-bottom-right">
|
<div class="composer-bottom-right">
|
||||||
{{#if site.mobileView}}
|
{{#if site.mobileView}}
|
||||||
|
{{#if allowUpload}}
|
||||||
<a class="mobile-file-upload {{if isUploading 'hidden'}}">{{i18n 'upload'}}</a>
|
<a class="mobile-file-upload {{if isUploading 'hidden'}}">{{i18n 'upload'}}</a>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#if showPreview}}
|
{{#if showPreview}}
|
||||||
{{d-button action='togglePreview' class='hide-preview' label='composer.hide_preview'}}
|
{{d-button action='togglePreview' class='hide-preview' label='composer.hide_preview'}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user