my_dashboard 0.5.5 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbaa5320eef1dcc36da9a59318ac33793e272104
4
- data.tar.gz: c36958495eaa364285d7de65f494ac21dfa637a5
3
+ metadata.gz: 3fb0eb750ecf6233c11d7cbd20edd9ef717d8137
4
+ data.tar.gz: bfa0ae3b997e3fb235b96d6930d78df43891dd7b
5
5
  SHA512:
6
- metadata.gz: 4b484d7c407470a144193d0bd4b97058359cce0431f8b06a98fc530aff76195efdbe29caa01bf3403cf93b030c82157ef319cfeff088691a9d0a507aa3d447e7
7
- data.tar.gz: df78278a5408153812aa97a36a388fe76a90f0eca0712f1e61143b3da416d85627d61dbc3d82345d38c8812a766a90855fd81cf817b23039177ec2dafaafce29
6
+ metadata.gz: b24bac8cb89ac355b2509fc02d3a69e38b20d4a1ead73c4c94aa8f25d2e12dd5ac8d6f55fb8e0dcd91246eda2f4a27ab286269b638f2826ea2107fe1b852a02f
7
+ data.tar.gz: fce9b5dca37dcc78ea9103e032eae39751fd44f208416a93d7700cbe4c0a201ad431135bb4ff111ab27307a111ec9b3f07ed71c292dabc244a08747009ed9a00
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.6 (05/17/2016)
2
+
3
+ * Fix render dashboard
4
+
1
5
  ## 0.5.5 (05/17/2016)
2
6
 
3
7
  * Fix call request error
@@ -0,0 +1,51 @@
1
+ # This file enables gridster integration (http://gridster.net/)
2
+ # Delete it if you'd rather handle the layout yourself.
3
+ # You'll miss out on a lot if you do, but we won't hold it against you.
4
+
5
+ MyDashboard.gridsterLayout = (positions) ->
6
+ MyDashboard.customGridsterLayout = true
7
+ positions = positions.replace(/^"|"$/g, '')
8
+ positions = $.parseJSON(positions)
9
+ widgets = $("[data-row]")
10
+ maxRow = 1
11
+ maxCol = 1
12
+ numColumns = MyDashboard.numColumns || 1
13
+ for widget, index in widgets
14
+ if positions? and index < positions.length
15
+ $(widget).attr('data-row', positions[index].row)
16
+ $(widget).attr('data-col', positions[index].col)
17
+ if positions[index].row > maxRow
18
+ maxRow = positions[index].row
19
+ maxCol = positions[index].col + 1
20
+ else if positions[index].row == maxRow and positions[index].col >= maxCol
21
+ maxCol = positions[index].col + 1
22
+ else
23
+ if maxCol > numColumns
24
+ maxRow += 1
25
+ maxCol = 1
26
+ $(widget).attr('data-row', maxRow)
27
+ $(widget).attr('data-col', maxCol)
28
+ maxCol += 1
29
+
30
+ MyDashboard.getWidgetPositions = ->
31
+ $(".gridster ul:first").gridster().data('gridster').serialize()
32
+
33
+ MyDashboard.showGridsterInstructions = ->
34
+ newWidgetPositions = MyDashboard.getWidgetPositions()
35
+
36
+ unless JSON.stringify(newWidgetPositions) == JSON.stringify(MyDashboard.currentWidgetPositions)
37
+ MyDashboard.currentWidgetPositions = newWidgetPositions
38
+ $('#save-gridster').slideDown()
39
+ $('#gridster-code').text("
40
+ <script type='text/javascript'>\n
41
+ $(function() {\n
42
+ \ \ MyDashboard.gridsterLayout('#{JSON.stringify(MyDashboard.currentWidgetPositions)}')\n
43
+ });\n
44
+ </script>
45
+ ")
46
+
47
+ $ ->
48
+ $('#save-gridster').leanModal()
49
+
50
+ $('#save-gridster').click ->
51
+ $('#save-gridster').slideUp()
@@ -1,3 +1,3 @@
1
1
  module MyDashboard
2
- VERSION = '0.5.5'
2
+ VERSION = '0.5.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danilo Vaz