Removed ability to copy a permalink on mobile

Этот коммит содержится в:
Reed Garmsen
2016-02-17 13:44:41 -08:00
родитель daa06ad41e
Коммит 6cc67e58f2
3 изменённых файлов: 58 добавлений и 52 удалений

Просмотреть файл

@@ -65,22 +65,24 @@ export default class PostInfo extends React.Component {
); );
} }
dropdownContents.push( if (!Utils.isMobile()) {
<li dropdownContents.push(
key='copyLink' <li
role='presentation' key='copyLink'
> role='presentation'
<a
href='#'
onClick={this.handlePermalink}
> >
<FormattedMessage <a
id='post_info.permalink' href='#'
defaultMessage='Permalink' onClick={this.handlePermalink}
/> >
</a> <FormattedMessage
</li> id='post_info.permalink'
); defaultMessage='Permalink'
/>
</a>
</li>
);
}
if (isOwner || isAdmin) { if (isOwner || isAdmin) {
dropdownContents.push( dropdownContents.push(

Просмотреть файл

@@ -97,22 +97,24 @@ class RhsComment extends React.Component {
var dropdownContents = []; var dropdownContents = [];
dropdownContents.push( if (!Utils.isMobile()) {
<li dropdownContents.push(
key='rhs-root-permalink' <li
role='presentation' key='rhs-root-permalink'
> role='presentation'
<a
href='#'
onClick={this.handlePermalink}
> >
<FormattedMessage <a
id='rhs_comment.permalink' href='#'
defaultMessage='Permalink' onClick={this.handlePermalink}
/> >
</a> <FormattedMessage
</li> id='rhs_comment.permalink'
); defaultMessage='Permalink'
/>
</a>
</li>
);
}
if (isOwner) { if (isOwner) {
dropdownContents.push( dropdownContents.push(

Просмотреть файл

@@ -5,7 +5,7 @@ import ChannelStore from '../stores/channel_store.jsx';
import UserProfile from './user_profile.jsx'; import UserProfile from './user_profile.jsx';
import UserStore from '../stores/user_store.jsx'; import UserStore from '../stores/user_store.jsx';
import * as TextFormatting from '../utils/text_formatting.jsx'; import * as TextFormatting from '../utils/text_formatting.jsx';
import * as utils from '../utils/utils.jsx'; import * as Utils from '../utils/utils.jsx';
import * as Emoji from '../utils/emoticons.jsx'; import * as Emoji from '../utils/emoticons.jsx';
import FileAttachmentList from './file_attachment_list.jsx'; import FileAttachmentList from './file_attachment_list.jsx';
import twemoji from 'twemoji'; import twemoji from 'twemoji';
@@ -40,7 +40,7 @@ export default class RhsRootPost extends React.Component {
this.parseEmojis(); this.parseEmojis();
} }
shouldComponentUpdate(nextProps) { shouldComponentUpdate(nextProps) {
if (!utils.areObjectsEqual(nextProps.post, this.props.post)) { if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) {
return true; return true;
} }
@@ -53,7 +53,7 @@ export default class RhsRootPost extends React.Component {
var post = this.props.post; var post = this.props.post;
var currentUser = UserStore.getCurrentUser(); var currentUser = UserStore.getCurrentUser();
var isOwner = currentUser.id === post.user_id; var isOwner = currentUser.id === post.user_id;
var isAdmin = utils.isAdmin(currentUser.roles); var isAdmin = Utils.isAdmin(currentUser.roles);
var timestamp = UserStore.getProfile(post.user_id).update_at; var timestamp = UserStore.getProfile(post.user_id).update_at;
var channel = ChannelStore.get(post.channel_id); var channel = ChannelStore.get(post.channel_id);
@@ -68,7 +68,7 @@ export default class RhsRootPost extends React.Component {
} }
var systemMessageClass = ''; var systemMessageClass = '';
if (utils.isSystemMessage(post)) { if (Utils.isSystemMessage(post)) {
systemMessageClass = 'post--system'; systemMessageClass = 'post--system';
} }
@@ -88,22 +88,24 @@ export default class RhsRootPost extends React.Component {
var dropdownContents = []; var dropdownContents = [];
dropdownContents.push( if (!Utils.isMobile()) {
<li dropdownContents.push(
key='rhs-root-permalink' <li
role='presentation' key='rhs-root-permalink'
> role='presentation'
<a
href='#'
onClick={this.handlePermalink}
> >
<FormattedMessage <a
id='rhs_root.permalink' href='#'
defaultMessage='Permalink' onClick={this.handlePermalink}
/> >
</a> <FormattedMessage
</li> id='rhs_root.permalink'
); defaultMessage='Permalink'
/>
</a>
</li>
);
}
if (isOwner) { if (isOwner) {
dropdownContents.push( dropdownContents.push(
@@ -198,7 +200,7 @@ export default class RhsRootPost extends React.Component {
} }
botIndicator = <li className='col col__name bot-indicator'>{'BOT'}</li>; botIndicator = <li className='col col__name bot-indicator'>{'BOT'}</li>;
} else if (utils.isSystemMessage(post)) { } else if (Utils.isSystemMessage(post)) {
userProfile = ( userProfile = (
<UserProfile <UserProfile
userId={''} userId={''}
@@ -209,12 +211,12 @@ export default class RhsRootPost extends React.Component {
); );
} }
let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + utils.getSessionIndex(); let src = '/api/v1/users/' + post.user_id + '/image?time=' + timestamp + '&' + Utils.getSessionIndex();
if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') { if (post.props && post.props.from_webhook && global.window.mm_config.EnablePostIconOverride === 'true') {
if (post.props.override_icon_url) { if (post.props.override_icon_url) {
src = post.props.override_icon_url; src = post.props.override_icon_url;
} }
} else if (utils.isSystemMessage(post)) { } else if (Utils.isSystemMessage(post)) {
src = Constants.SYSTEM_MESSAGE_PROFILE_IMAGE; src = Constants.SYSTEM_MESSAGE_PROFILE_IMAGE;
} }