/
application.coffee
32 lines (26 loc) · 1.19 KB
/
application.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Use the Yaffle EventSource polyfill to work around browser issues
#= require eventsource.min.js
# dashing.js is located in the dashing framework
# It includes jquery & batman for you.
#= require dashing.js
#= require_directory .
#= require_tree ../../widgets
console.log("Yeah! The dashboard has started!")
Dashing.on 'ready', ->
Dashing.widget_margins ||= [5, 5]
Dashing.widget_base_dimensions ||= [145, 145]
Dashing.numColumns ||= 7
Dashing.cycleDashboards({timeInSeconds: 0, stagger: true, page: 1});
contentWidth = (Dashing.widget_base_dimensions[0] + Dashing.widget_margins[0] * 2) * Dashing.numColumns
Batman.setImmediate ->
$('.gridster').width(contentWidth)
$('.gridster > ul').gridster
widget_margins: Dashing.widget_margins
widget_base_dimensions: Dashing.widget_base_dimensions
avoid_overlapped_widgets: !Dashing.customGridsterLayout
draggable:
stop: Dashing.showGridsterInstructions
start: -> Dashing.currentWidgetPositions = Dashing.getWidgetPositions()
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) )
$('.gridster > ul').each ->
$(@).gridster().data('gridster').draggable().disable()