From d42da8737e5db266992142e23f076ba3b6fb1072 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Wed, 24 Jul 2019 12:36:33 +0800 Subject: [PATCH] Improve readability of selectors in page alert JS directive --- .../darkswarm/directives/page_alert.js.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee b/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee index ef3a841d8e..a3858444ae 100644 --- a/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/page_alert.js.coffee @@ -2,7 +2,14 @@ Darkswarm.directive "ofnPageAlert", ($timeout) -> restrict: 'A' scope: true link: (scope, elem, attrs) -> - container_elems = $(".off-canvas-wrap .inner-wrap, .off-canvas-wrap .inner-wrap .fixed, .off-canvas-fixed .top-bar, .off-canvas-fixed ofn-flash, .off-canvas-fixed nav.tab-bar, .off-canvas-fixed .page-alert") + moveSelectors = [".off-canvas-wrap .inner-wrap", + ".off-canvas-wrap .inner-wrap .fixed", + ".off-canvas-fixed .top-bar", + ".off-canvas-fixed ofn-flash", + ".off-canvas-fixed nav.tab-bar", + ".off-canvas-fixed .page-alert"] + + container_elems = $(moveSelectors.join(", ")) # Wait a moment after page load before showing the alert. Otherwise we often miss the # start of the animation.