summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/breakpoints.coffee
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-07-24 23:45:11 +0300
committerFatih Acet <acetfatih@gmail.com>2016-07-24 23:45:11 +0300
commitaaa9509d120524573085e94af9de5cdde83e3271 (patch)
tree3824cffd4cdd132ee9cf75a00a7624f5ccc0dabd /app/assets/javascripts/breakpoints.coffee
parent56b79181adc0bd6e9abef97ea075c14be971a01a (diff)
downloadgitlab-ce-aaa9509d120524573085e94af9de5cdde83e3271.tar.gz
ES6ify all the things!
Diffstat (limited to 'app/assets/javascripts/breakpoints.coffee')
-rw-r--r--app/assets/javascripts/breakpoints.coffee37
1 files changed, 0 insertions, 37 deletions
diff --git a/app/assets/javascripts/breakpoints.coffee b/app/assets/javascripts/breakpoints.coffee
deleted file mode 100644
index 5457430f921..00000000000
--- a/app/assets/javascripts/breakpoints.coffee
+++ /dev/null
@@ -1,37 +0,0 @@
-class @Breakpoints
- instance = null;
-
- class BreakpointInstance
- BREAKPOINTS = ["xs", "sm", "md", "lg"]
-
- constructor: ->
- @setup()
-
- setup: ->
- allDeviceSelector = BREAKPOINTS.map (breakpoint) ->
- ".device-#{breakpoint}"
- return if $(allDeviceSelector.join(",")).length
-
- # Create all the elements
- els = $.map BREAKPOINTS, (breakpoint) ->
- "<div class='device-#{breakpoint} visible-#{breakpoint}'></div>"
- $("body").append els.join('')
-
- visibleDevice: ->
- allDeviceSelector = BREAKPOINTS.map (breakpoint) ->
- ".device-#{breakpoint}"
- $(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: ->
- return instance ?= new BreakpointInstance
-
-$ =>
- @bp = Breakpoints.get()