sortablelabel-js 0.5 → 0.6

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: 85e0324fe2f942d834a6efc5c8517b63bd59b147
4
- data.tar.gz: d071ee6986c32ccd92bb4703fc389d2183f9eb4a
3
+ metadata.gz: 499e805b615f15f06b64abdab9207764b29040fe
4
+ data.tar.gz: fdda77defd0b39be9a123940486c3ef6d6c873bf
5
5
  SHA512:
6
- metadata.gz: 265e296d18316c74ec4499d62c92ba41a90d3fed7c7103deeba5bec42b855cee087cee557836741255fcc1a6709671cf953a9a5f1d92eb4f0d32356231bd951b
7
- data.tar.gz: 178da795b612d05fbdce5f7133f4d9078ac86b6b81164d1acbfcac84528e8afeccffd125f30a835457f92e8b46f9b08293ab6f989521e1f2ac911adc863bd4b3
6
+ metadata.gz: 387c0b3402db0a0f035ba640a59cc0f35d67d967a7998e5dff7a36cbef32a282c09f4a980da82979999df5d90c44f780d6d37e9063633100c3d8dc82ba48571c
7
+ data.tar.gz: 2b3a2a8aacd20bb75301551fca93b52b74ee4f4f6443a47da6e03b9901379bc35bbe7abfe14223bf8f2cd55070b77290c8264007293ef63472fe0dc0f4a70002
@@ -1,5 +1,5 @@
1
1
  module Sortablelabel
2
2
  module Js
3
- VERSION = "0.5"
3
+ VERSION = "0.6"
4
4
  end
5
5
  end
@@ -4,9 +4,11 @@ class @SortableLabel
4
4
  sortableItem: '> div.fields'
5
5
  labelTarget: 'label'
6
6
  positionTarget: '.position-field'
7
+ subPositionTarget: '.sub-position-field'
7
8
  nestedTarget: null
8
9
  removeField: "input[id$='_destroy']"
9
10
  label: 'Step '
11
+ groupLabel: 'Group'
10
12
  minimun: 0
11
13
 
12
14
  constructor: (scope, options) ->
@@ -96,10 +98,12 @@ class @SortableLabel
96
98
  name: tempLabel,
97
99
  count: 1
98
100
  )
99
- $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " 1")
101
+ $(this).closest('.fields').find(_this.options['subPositionTarget']).val(1)
102
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " 1")
100
103
  else if _index > -1
101
104
  week_group_label_list[_index].count += 1
102
- $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + week_group_label_list[_index].count)
105
+ $(this).closest('.fields').find(_this.options['subPositionTarget']).val(week_group_label_list[_index].count)
106
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " " + week_group_label_list[_index].count)
103
107
  )
104
108
  )
105
109
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sortablelabel-js
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe