diff options
author | Rémy Coutable <remy@rymai.me> | 2016-10-14 17:25:41 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-17 14:13:26 +0200 |
commit | 42195ff6598349d2d45813eedd2184ec3f9b5175 (patch) | |
tree | f176ff6dc415b8c6181fc455ce333cd19470ac54 | |
parent | ab92551bbd98c5f51cb3aa8073f8dc108b19ceea (diff) | |
download | gitlab-ce-42195ff6598349d2d45813eedd2184ec3f9b5175.tar.gz |
Merge branch 'gfm-source-once' into 'master'
Loads GFM once for per page
## What does this MR do?
Currently the GFM init code is included every time there is a GFM form on the page. This changes that & only includes in once if any number of GFM forms are on the page.
## What are the relevant issue numbers?
#22827
See merge request !6840
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/views/layouts/application.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/_zen.html.haml | 4 |
3 files changed, 3 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG index f849d6eec64..3a3f3e35664 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -7,6 +7,7 @@ v 8.12.7 - Prevent flash alert text from being obscured when container is fluid. !6694 - Fix JS bug with select2 because of missing `data-field` attribute in select box. !6812 - Do not alter 'force_remove_source_branch' options on MergeRequest unless specified. !6817 + - Fix GFM autocomplete setup being called several times. !6840 v 8.12.6 - Update mailroom to 0.8.1 in Gemfile.lock !6814 diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 15a94ac23c5..6c2285fa2b6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -11,3 +11,4 @@ = render 'layouts/page', sidebar: sidebar, nav: nav = yield :scripts_body + = render "layouts/init_auto_complete" if @gfm_form diff --git a/app/views/projects/_zen.html.haml b/app/views/projects/_zen.html.haml index cb97181b9e1..0c8241053e7 100644 --- a/app/views/projects/_zen.html.haml +++ b/app/views/projects/_zen.html.haml @@ -1,3 +1,4 @@ +- @gfm_form = true - supports_slash_commands = local_assigns.fetch(:supports_slash_commands, false) .zen-backdrop - classes << ' js-gfm-input js-autosize markdown-area' @@ -7,6 +8,3 @@ = text_area_tag attr, nil, class: classes, placeholder: placeholder %a.zen-control.zen-control-leave.js-zen-leave{ href: "#" } = icon('compress') - -- content_for :scripts_body do - = render "layouts/init_auto_complete" if current_user && (@target_project || @project) |