Skip to content
Snippets Groups Projects
Commit d49193c4 authored by Eric Eastwood's avatar Eric Eastwood
Browse files

Disable autocomplete on snippets comments

parent 4124a1fb
No related branches found
No related tags found
No related merge requests found
Pipeline #
Loading
Loading
@@ -79,7 +79,18 @@ import initSettingsPanels from './settings_panels';
path = page.split(':');
shortcut_handler = null;
 
new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources).setup();
$('.js-gfm-input').each((i, el) => {
const gfm = new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources);
const enableGFM = gl.utils.convertPermissionToBoolean(el.dataset.supportsAutocomplete);
gfm.setup($(el), {
emojis: true,
members: enableGFM,
issues: enableGFM,
milestones: enableGFM,
mergeRequests: enableGFM,
labels: enableGFM,
});
});
 
function initBlob() {
new LineHighlighter();
Loading
Loading
Loading
Loading
@@ -4,7 +4,11 @@
.zen-backdrop
- classes << ' js-gfm-input js-autosize markdown-area'
- if defined?(f) && f
= f.text_area attr, class: classes, placeholder: placeholder, data: { supports_slash_commands: supports_slash_commands }
= f.text_area attr,
class: classes,
placeholder: placeholder,
data: { supports_slash_commands: supports_slash_commands,
supports_autocomplete: supports_autocomplete }
- else
= text_area_tag attr, current_text, class: classes, placeholder: placeholder
%a.zen-control.zen-control-leave.js-zen-leave{ href: "#" }
Loading
Loading
Loading
Loading
@@ -9,4 +9,4 @@
.row-content-block.top-block.content-component-block
= render 'award_emoji/awards_block', awardable: @snippet, inline: true
 
#notes= render "shared/notes/notes_with_form", :autocomplete => true
#notes= render "shared/notes/notes_with_form", :autocomplete => false
Loading
Loading
@@ -27,7 +27,8 @@
attr: :note,
classes: 'note-textarea js-note-text',
placeholder: "Write a comment or drag your files here...",
supports_slash_commands: supports_slash_commands
supports_slash_commands: supports_slash_commands,
supports_autocomplete: supports_autocomplete
= render 'shared/notes/hints', supports_slash_commands: supports_slash_commands
.error-alert
 
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@
%a.author_link{ href: user_path(current_user) }
= image_tag avatar_icon(current_user), alt: current_user.to_reference, class: 'avatar s40'
.timeline-content.timeline-content-form
= render "shared/notes/form", view: diff_view
= render "shared/notes/form", view: diff_view, supports_autocomplete: autocomplete
- elsif !current_user
.disabled-comment.text-center.prepend-top-default
Please
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment