dashing-rails 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c4f2ac2b83de93b59cde2a8a721ff3c1da134ff
4
- data.tar.gz: f5fcc3a0285c077218d15c4142e4389649b65ddf
3
+ metadata.gz: 8dfddde01d385b4094caeb1dfa91d57eb3661695
4
+ data.tar.gz: f7afc786e36b73efdd1cd121818fe3dc3fb3f7dc
5
5
  SHA512:
6
- metadata.gz: 88dc2c0fd8d2763013d8055edc89801283a0bbfb9ab8a694f026d253a49f077db7afb46cfe7bbfbb2ad1e95029928c6a728005f3369d199da5289dfe7930ae5b
7
- data.tar.gz: 393ec5fc545d3a31a3feb0b84444847abe82ee9605af6cac7f0482b93e53882d2d5c10b049e9b794121e1cbc458946c2e8adcd08fb26c284ae65d6e6052f2792
6
+ metadata.gz: ec6a9a63a1191a23eea315b6e22b6eb4b58045c9f5d6d8f2de73340f0c49deb1eefcdc53b6e0f3fa2351c04f61c020b556d8f85e608f43cfcdf0577c2742450b
7
+ data.tar.gz: e4146726fc36bc5e96d4cf2251d9d811387ea41e1ddffed1d9932375ca2d8be24c706618492b863ad9433fe07581fb38dd9430102119ccad6ff8ffa5fc659123
@@ -1,3 +1,7 @@
1
+ ## 2.6.1
2
+
3
+ * Revert gridster dashing to a newer version
4
+
1
5
  ## 2.6.0
2
6
 
3
7
  * Upgrade assets based on [Dashing](https://github.com/Shopify/dashing) repo
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dashing-rails (2.6.0)
4
+ dashing-rails (2.6.1)
5
5
  coffee-script (>= 2.0)
6
6
  connection_pool (~> 2.2)
7
7
  jquery-rails (>= 3.0)
@@ -6,10 +6,26 @@ Dashing.gridsterLayout = (positions) ->
6
6
  Dashing.customGridsterLayout = true
7
7
  positions = positions.replace(/^"|"$/g, '')
8
8
  positions = $.parseJSON(positions)
9
- widgets = $("[data-row^=]")
9
+ widgets = $("[data-row]")
10
+ maxRow = 1
11
+ maxCol = 1
12
+ numColumns = Dashing.numColumns || 1
10
13
  for widget, index in widgets
11
- $(widget).attr('data-row', positions[index].row)
12
- $(widget).attr('data-col', positions[index].col)
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
13
29
 
14
30
  Dashing.getWidgetPositions = ->
15
31
  $(".gridster ul:first").gridster().data('gridster').serialize()
@@ -24,7 +40,9 @@ Dashing.showGridsterInstructions = ->
24
40
  <script type='text/javascript'>\n
25
41
  $(function() {\n
26
42
  \ \ Dashing.gridsterLayout('#{JSON.stringify(Dashing.currentWidgetPositions)}')\n
27
- });\n</script>")
43
+ });\n
44
+ </script>
45
+ ")
28
46
 
29
47
  $ ->
30
48
  $('#save-gridster').leanModal()
@@ -1,3 +1,3 @@
1
1
  module Dashing
2
- VERSION = '2.6.0'
2
+ VERSION = '2.6.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashing-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Louis Gottfrois