sortablelabel-js 0.2 → 0.3

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: 71385c5813d4188ea83464d76fdd1f6950a90539
4
- data.tar.gz: ea864efa48fd500c6115d8e841c63a10f0672371
3
+ metadata.gz: 07733852ec9bcfa1a0eb47efd0f1298858fcdc3a
4
+ data.tar.gz: 1ccb786108c52d45399be49c47239d9035363f1a
5
5
  SHA512:
6
- metadata.gz: d898130a6a34b2cd01bf72ddb5edd783a0e40ac8564e89de56a95f7c2ebe212aa5bf57ce2f44ec7dae56f43742d269192fe3c91c94f3bc97999694be8bc796e2
7
- data.tar.gz: 804c7d4a29d044a44bdf0463721ecbf2b620af54969f8052a4f5b6c218601e87302a0b3dff31fbdfb6e80e04bd50f9027f5d8a1e5e09fff2251e4247c2520840
6
+ metadata.gz: e2dcb66f162fde50af2d15801f489d9ef490b505eab5ea9e51e12e3c28243591a1e3173c60812e23db39a32784270f8d72b4e76f868dc30b82b54af8b4ff81b1
7
+ data.tar.gz: 890ccf361aa1c413ce7cfcfe11dfb75a16eabf87154b1b62a520da17f1467319446262c3236950b241b0230e93cf309763d7a3a316626696f6702345471ad5d7
@@ -1,5 +1,5 @@
1
1
  module Sortablelabel
2
2
  module Js
3
- VERSION = "0.2"
3
+ VERSION = "0.3"
4
4
  end
5
5
  end
@@ -49,12 +49,12 @@ class @SortableLabel
49
49
  calInitStepLable: ->
50
50
  this.calLabel(this.options['removeField']+'[value=false]')
51
51
  if this.options['weekGroupLabelTarget']
52
- this.calWeekGroupLabel(this.options['weekGroupLabelTarget'], true)
52
+ this.calWeekGroupLabel(this.options['weekGroupLabelTarget'])
53
53
 
54
54
  calStepLable: ->
55
55
  this.calLabel(this.options['removeField']+'[value=false]')
56
56
  if this.options['weekGroupLabelTarget']
57
- this.calWeekGroupLabel(this.options['weekGroupLabelTarget'], false)
57
+ this.calWeekGroupLabel(this.options['weekGroupLabelTarget'])
58
58
 
59
59
  calLabel: (target) ->
60
60
  _this = this
@@ -84,16 +84,12 @@ class @SortableLabel
84
84
  )
85
85
  )
86
86
 
87
- calWeekGroupLabel: (target, is_first) ->
87
+ calWeekGroupLabel: (target) ->
88
88
  _this = this
89
89
  week_group_label_list = []
90
90
  $(@target).each(->
91
91
  $(this).find(target).each(->
92
- tempLabel = ''
93
- if is_first
94
- tempLabel = $(this).text()
95
- else
96
- tempLabel = $(this).text().substr(0, $(this).text().lastIndexOf(' '))
92
+ tempLabel = $(this).text()
97
93
  _index = _this.isIncludeWeekGroup(tempLabel, week_group_label_list)
98
94
  if _index is -1
99
95
  week_group_label_list.push(
@@ -108,7 +104,7 @@ class @SortableLabel
108
104
  )
109
105
 
110
106
  isIncludeWeekGroup: (item, arr)->
111
- if item == " "
107
+ if item == " " || item.trim() == ""
112
108
  return -2
113
109
  for _item, index in arr
114
110
  return index if _item.name is item
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.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe