sortablelabel-js 0.6 → 0.7

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: 499e805b615f15f06b64abdab9207764b29040fe
4
- data.tar.gz: fdda77defd0b39be9a123940486c3ef6d6c873bf
3
+ metadata.gz: bcb174b958a8a05fee37c0844a832d103c61cccb
4
+ data.tar.gz: 10949d6831b2cf476692e8346111269f6a0598ae
5
5
  SHA512:
6
- metadata.gz: 387c0b3402db0a0f035ba640a59cc0f35d67d967a7998e5dff7a36cbef32a282c09f4a980da82979999df5d90c44f780d6d37e9063633100c3d8dc82ba48571c
7
- data.tar.gz: 2b3a2a8aacd20bb75301551fca93b52b74ee4f4f6443a47da6e03b9901379bc35bbe7abfe14223bf8f2cd55070b77290c8264007293ef63472fe0dc0f4a70002
6
+ metadata.gz: dffdbef8491ea6d7a8bee685054bbfdf4a0ab591fb5e9d1ca8c1cb28744d97554d50321184e5c83cbbb851f38ae9205d1029edd9e5894551d3c09ed303171b1c
7
+ data.tar.gz: dfa77cd4520b257a8c06153f8480ae41d9681e20f0fd90469dbb181eebaf1229d056a4ec10939f133a9f3e78b2cd40b15cba9977baeb928ef1ca1ff3b3684f0e
@@ -1,5 +1,5 @@
1
1
  module Sortablelabel
2
2
  module Js
3
- VERSION = "0.6"
3
+ VERSION = "0.7"
4
4
  end
5
5
  end
data/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "Extension of jquery-sortable javascript library",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
- "test": "./node_modules/karma/bin/karma start my.conf.js",
7
+ "test": "./node_modules/karma/bin/karma start my.conf.js --reporters nyan",
8
8
  "dependency": "npm install | bower install"
9
9
  },
10
10
  "author": "",
@@ -16,6 +16,7 @@
16
16
  "karma-coffee-preprocessor": "^1.0.1",
17
17
  "karma-coverage": "^1.1.1",
18
18
  "karma-jasmine": "^1.1.0",
19
- "karma-jasmine-jquery": "^0.1.1"
19
+ "karma-jasmine-jquery": "^0.1.1",
20
+ "karma-nyan-reporter": "^0.2.5"
20
21
  }
21
22
  }
@@ -4,11 +4,9 @@ class @SortableLabel
4
4
  sortableItem: '> div.fields'
5
5
  labelTarget: 'label'
6
6
  positionTarget: '.position-field'
7
- subPositionTarget: '.sub-position-field'
8
7
  nestedTarget: null
9
8
  removeField: "input[id$='_destroy']"
10
9
  label: 'Step '
11
- groupLabel: 'Group'
12
10
  minimun: 0
13
11
 
14
12
  constructor: (scope, options) ->
@@ -98,12 +96,20 @@ class @SortableLabel
98
96
  name: tempLabel,
99
97
  count: 1
100
98
  )
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")
99
+ if typeof _this.options['subPositionTarget'] == 'string'
100
+ $(this).closest('.fields').find(_this.options['subPositionTarget']).val(1)
101
+ if typeof _this.options['groupLabel'] == 'string'
102
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " 1")
103
+ else
104
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel)
103
105
  else if _index > -1
104
106
  week_group_label_list[_index].count += 1
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)
107
+ if typeof _this.options['subPositionTarget'] == 'string'
108
+ $(this).closest('.fields').find(_this.options['subPositionTarget']).val(week_group_label_list[_index].count)
109
+ if typeof _this.options['groupLabel'] == 'string'
110
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " " + week_group_label_list[_index].count)
111
+ else
112
+ $(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel)
107
113
  )
108
114
  )
109
115
 
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.6'
4
+ version: '0.7'
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-03 00:00:00.000000000 Z
11
+ date: 2017-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler