diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-04-05 11:24:41 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-04-05 11:24:41 +0300 |
commit | 10143937c1fdfe2ef4628f32a1e87ca564233d17 (patch) | |
tree | 6e8e158a91edb66d9b641a0d277ead46e79b6807 /app/assets/javascripts | |
parent | 166b4575a6353668c894fea0ba234d0b371dee03 (diff) |
Add page helper methods for notesApp
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/lib/utils/dom_utils.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/dom_utils.js b/app/assets/javascripts/lib/utils/dom_utils.js index de65ea15a60..914de9de940 100644 --- a/app/assets/javascripts/lib/utils/dom_utils.js +++ b/app/assets/javascripts/lib/utils/dom_utils.js @@ -1,7 +1,12 @@ -/* eslint-disable import/prefer-default-export */ +import $ from 'jquery'; +import { isInIssuePage, isInMRPage, isInEpicPage, hasVueMRDiscussionsCookie } from './common_utils'; + +const isVueMRDiscussions = () => isInMRPage() && hasVueMRDiscussionsCookie() && !$('#diffs').is(':visible'); export const addClassIfElementExists = (element, className) => { if (element) { element.classList.add(className); } }; + +export const isInVueNoteablePage = () => isInIssuePage() || isInEpicPage() || isVueMRDiscussions(); |