Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use simpleMDE editor on mobile devices for 1.13 #14029

Merged
merged 4 commits into from
Dec 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {createCodeEditor} from './features/codeeditor.js';
import {svg, svgs} from './svg.js';

const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
mrsdizzie marked this conversation as resolved.
Show resolved Hide resolved

let previewFileModes;
const commentMDEditors = {};
Expand Down Expand Up @@ -385,8 +386,14 @@ function initCommentForm() {
if ($('.comment.form').length === 0) {
return;
}

autoSimpleMDE = setCommentSimpleMDE($('.comment.form textarea:not(.review-textarea)'));

// Don't use simpleMDE on mobile due to multiple bug reports which go unfixed
// Other sections rely on it being initialized so just set it back to text area here
if (isMobile) {
autoSimpleMDE.toTextArea();
}

initBranchSelector();
initCommentPreviewTab($('.comment.form'));
initImagePaste($('.comment.form textarea'));
Expand Down