diff options
author | Phil Hughes <me@iamphill.com> | 2018-04-09 10:52:49 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-04-09 10:52:49 +0300 |
commit | e7ddb40cd595215d42e2ab9790462ae9bcd7a0cb (patch) | |
tree | 4dc0cf0fce486ff93d09e7807f48ceda25d1cbdb /app | |
parent | e9947951a596c3c0d290bee1f7faa30fb824c5e3 (diff) | |
parent | d2482f15e19695e2f89284d9a0219c6b4b4f401c (diff) |
Merge branch '32617-fix-template-selector-menu-visibility' into 'master'
Resolve "Template selectors menu title mistakenly shown after toggling previewed changes"
Closes #32617
See merge request gitlab-org/gitlab-ce!18118
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/blob/file_template_mediator.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/blob/file_template_selector.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/blob/file_template_mediator.js b/app/assets/javascripts/blob/file_template_mediator.js index 030ca1907e5..ff1cbcad145 100644 --- a/app/assets/javascripts/blob/file_template_mediator.js +++ b/app/assets/javascripts/blob/file_template_mediator.js @@ -94,7 +94,7 @@ export default class FileTemplateMediator { const hash = urlPieces[1]; if (hash === 'preview') { this.hideTemplateSelectorMenu(); - } else if (hash === 'editor') { + } else if (hash === 'editor' && !this.typeSelector.isHidden()) { this.showTemplateSelectorMenu(); } }); diff --git a/app/assets/javascripts/blob/file_template_selector.js b/app/assets/javascripts/blob/file_template_selector.js index e52cf249f3a..02228434a29 100644 --- a/app/assets/javascripts/blob/file_template_selector.js +++ b/app/assets/javascripts/blob/file_template_selector.js @@ -32,6 +32,10 @@ export default class FileTemplateSelector { } } + isHidden() { + return this.$wrapper.hasClass('hidden'); + } + getToggleText() { return this.$dropdownToggleText.text(); } |