sortablelabel-js 0.3 → 0.4

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: 07733852ec9bcfa1a0eb47efd0f1298858fcdc3a
4
- data.tar.gz: 1ccb786108c52d45399be49c47239d9035363f1a
3
+ metadata.gz: 45d3630a00b1f5ee6383877574702981bae6b08d
4
+ data.tar.gz: 3c22746f6e44036b9a264ed2b0472fab806f2911
5
5
  SHA512:
6
- metadata.gz: e2dcb66f162fde50af2d15801f489d9ef490b505eab5ea9e51e12e3c28243591a1e3173c60812e23db39a32784270f8d72b4e76f868dc30b82b54af8b4ff81b1
7
- data.tar.gz: 890ccf361aa1c413ce7cfcfe11dfb75a16eabf87154b1b62a520da17f1467319446262c3236950b241b0230e93cf309763d7a3a316626696f6702345471ad5d7
6
+ metadata.gz: 9a94966a2d30916c07b46378e91be52b221bdc1da8ac864ff1d2d1c4553c729b2598b72e3577dc875ad4a4be09cf8f77ff3616eda3e872c252e4b98642832f9e
7
+ data.tar.gz: 1a1af8ebcccef936e778cd8e0dc3a517cef8eb98f54b80b55ba56f95dbd2f52943eacf492bbe1a4404b8dd4cce8916dceb0f3cd46992ede0c4693de7a61e6f90
@@ -1,5 +1,5 @@
1
1
  module Sortablelabel
2
2
  module Js
3
- VERSION = "0.3"
3
+ VERSION = "0.4"
4
4
  end
5
5
  end
@@ -61,13 +61,14 @@ class @SortableLabel
61
61
  $(@target).each(->
62
62
  stepCount = 1
63
63
  $(this).find(target).each( ->
64
+ $(this).closest('.fields').find(_this.options['positionTarget']).val(stepCount)
64
65
  if typeof(_this.options['label']) == 'string'
65
- if _this.options['label'].trim() == 'Day'
66
- $(this).closest('.fields').find(_this.options['labelTarget']).html(_this.dayOfWeek(stepCount - 1))
67
- stepCount += 1
66
+ if _this.options['label'].trim() == 'Day'
67
+ $(this).closest('.fields').find(_this.options['labelTarget']).html(_this.dayOfWeek(stepCount))
68
+ stepCount += 1
68
69
  else
69
70
  if _this.options['fieldName']
70
- if $(this).closest('.fields').find('.remove_nested_fields').data('association') == _this.options['fieldName']
71
+ if $(this).parent().find('.remove_nested_fields').data('association') == _this.options['fieldName']
71
72
  $(this).closest('.fields').find(_this.options['labelTarget']).html(_this.options['label'] + stepCount)
72
73
  stepCount += 1
73
74
  else
@@ -75,7 +76,6 @@ class @SortableLabel
75
76
  else if typeof(_this.options['label']) == 'function'
76
77
  $(this).closest('.fields').find(_this.options['labelTarget']).html(_this.options['label'].call($(this).closest('.fields').find(_this.options['labelTarget']), stepCount))
77
78
  stepCount += 1
78
- $(this).closest('.fields').find(_this.options['positionTarget']).val(stepCount)
79
79
  if _this.options['minimun'] >= stepCount
80
80
  $(this).closest('.fields').find('.remove_nested_fields').hide();
81
81
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sortablelabel-js
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler