summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-15 09:41:29 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-03-15 09:41:29 +0000
commit9403142083bf0ace81fc3059f2d6c5a494e48cbf (patch)
treec7b0675ecda034802419d09ce6876fb324ce473a /app
parent19ecfb5c854ba45125ae50136372101a8d8424fb (diff)
parent4fc2dcc4f479f0d2676004406b247548bfc64c86 (diff)
downloadgitlab-ce-9403142083bf0ace81fc3059f2d6c5a494e48cbf.tar.gz
Merge branch 'filter-bug-fix' into 'master'
Fix bug with JS error from dropdowns in filter area Fixes: ![consoleerror](/uploads/0fa19a943050baac855c9e6f896ea941/consoleerror.png) This error is not a logged issue yet. Error when turbolinks fetches a new page, `setup()` was not run. Signed-off-by: Jacob Schatz jschatz@gitlab.com cc @iamphill @alfredo1 See merge request !3216
Diffstat (limited to 'app')
-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: ->