summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-14 23:23:30 -0400
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-14 23:23:30 -0400
commit4fc2dcc4f479f0d2676004406b247548bfc64c86 (patch)
tree9d0dbce8668634686e0791060155dd03efcad77f
parentc4b35a623016bb8a3402d9a53fb9df7a990ad9aa (diff)
downloadgitlab-ce-filter-bug-fix.tar.gz
Fix bug with JS error from dropdowns in filter areafilter-bug-fix
-rw-r--r--app/assets/javascripts/breakpoints.coffee12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/assets/javascripts/breakpoints.coffee b/app/assets/javascripts/breakpoints.coffee
index 1ffaaddb055..5457430f921 100644
--- a/app/assets/javascripts/breakpoints.coffee
+++ b/app/assets/javascripts/breakpoints.coffee
@@ -10,7 +10,6 @@ class @Breakpoints
setup: ->
allDeviceSelector = BREAKPOINTS.map (breakpoint) ->
".device-#{breakpoint}"
-
return if $(allDeviceSelector.join(",")).length
# Create all the elements
@@ -18,12 +17,17 @@ class @Breakpoints
"<div class='device-#{breakpoint} visible-#{breakpoint}'></div>"
$("body").append els.join('')
- getBreakpointSize: ->
+ visibleDevice: ->
allDeviceSelector = BREAKPOINTS.map (breakpoint) ->
".device-#{breakpoint}"
+ $(allDeviceSelector.join(",")).filter(":visible")
- $visibleDevice = $(allDeviceSelector.join(",")).filter(":visible")
-
+ getBreakpointSize: ->
+ $visibleDevice = @visibleDevice
+ # the page refreshed via turbolinks
+ if not $visibleDevice().length
+ @setup()
+ $visibleDevice = @visibleDevice()
return $visibleDevice.attr("class").split("visible-")[1]
@get: ->