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

Initialize SimpleMDE when making a code comment #11749

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jun 3, 2020

Fix #11704

Signed-off-by: Andrew Thornton [email protected]

@zeripath zeripath added topic/ui Change the appearance of the Gitea UI backport/v1.12 labels Jun 3, 2020
@zeripath zeripath added this to the 1.13.0 milestone Jun 3, 2020
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jun 4, 2020

// Give new write/preview data-tab name to distinguish from others
const $simplemde = setCommentSimpleMDE($textarea);
$textarea.focus();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this focus for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's copying the same code as the $('.edit-content').on('click', async function (event) {...}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a noop to me unless the textarea focus triggers something, but whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's likely a no-op - but's it's present elsewhere and so I think it's prudent to put it there in case it's there for a reason. I don't want to introduce a new heisenbug.

web_src/js/index.js Outdated Show resolved Hide resolved
@CirnoT
Copy link
Contributor

CirnoT commented Jun 4, 2020

Still broken for reply

@CirnoT
Copy link
Contributor

CirnoT commented Jun 4, 2020

Needs styling fixes now as currently it has been styled to match textarea only

Index: web_src/less/_review.less
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web_src/less/_review.less	(revision 0814066a3e59714ab5d4790ceefe3477c7178c72)
+++ web_src/less/_review.less	(date 1591292279994)
@@ -54,15 +54,14 @@
             border: 0;
             padding: 0;
             margin: 0;
-
-            &.markdown {
-                padding: 1em;
-                min-height: 168px;
-            }
         }
 
         &.header {
             padding: .1rem 1rem;
+
+            .text {
+                margin: 0;
+            }
         }
     }
 
@@ -76,18 +75,16 @@
     }
 
     .ui.active.tab {
-        border: 1px solid #d4d4d5;
         padding: .5em;
-        border-radius: 0 .28571429rem .28571429rem;
-    }
 
-    .ui.active.markdown.tab {
-        border-top-left-radius: .28571429rem;
+        &.markdown {
+            padding: 1em;
+            min-height: 168px;
+        }
     }
 
     .ui.tabular.menu {
-        margin-bottom: 0;
-        border-bottom: 0;
+        margin: .5em;
     }
 
     .comment-list {

web_src/js/index.js Outdated Show resolved Hide resolved
zeripath and others added 4 commits June 4, 2020 19:47
Co-Authored-By: Cirno the Strongest <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
…thub.com:zeripath/gitea into fix-11704-initialize-simplemde-for-code-comments
@CirnoT
Copy link
Contributor

CirnoT commented Jun 6, 2020

Still broken for replying to code comments

chrome_2020-06-06_14-52-37

@zeripath
Copy link
Contributor Author

zeripath commented Jun 6, 2020

I wasn't aware that was broken at all...

@CirnoT
Copy link
Contributor

CirnoT commented Jun 6, 2020

Markdown bar is shown now on edit and creation, so it makes sense that it would be shown for replies too.

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath
Copy link
Contributor Author

zeripath commented Jun 6, 2020

done

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 6, 2020
@zeripath zeripath merged commit 1ee6c13 into go-gitea:master Jun 6, 2020
@zeripath zeripath deleted the fix-11704-initialize-simplemde-for-code-comments branch June 6, 2020 14:15
zeripath added a commit to zeripath/gitea that referenced this pull request Jun 6, 2020
Backport go-gitea#11749

Fix go-gitea#11704

Signed-off-by: Andrew Thornton <[email protected]>
Co-Authored-By: Cirno the Strongest <[email protected]>
techknowlogick added a commit that referenced this pull request Jun 7, 2020
Backport #11749

Fix #11704

Signed-off-by: Andrew Thornton <[email protected]>
Co-Authored-By: Cirno the Strongest <[email protected]>

Co-authored-by: Cirno the Strongest <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
@6543
Copy link
Member

6543 commented Jun 7, 2020

Need label backport/done

@zeripath zeripath added the backport/done All backports for this PR have been created label Jun 7, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
Fix go-gitea#11704

Signed-off-by: Andrew Thornton <[email protected]>
Co-Authored-By: Cirno the Strongest <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

markdown tab not appears in comment creation
5 participants