sortablelabel-js 0.8 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sortablelabel/js/version.rb +1 -1
- data/vendor/assets/javascripts/sortable_label.coffee +40 -36
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9092cbe06787f0323d0037755638116c84745808
|
4
|
+
data.tar.gz: b0965d4ddc4bca909fe5e49b41fea7b2b1f7bf79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f563c296378c8b29a637071467675f4ec5357424bebeddc1757afdca2b24b098109621a27679bde1867db192c8b805f5cdee348c12691dd89daf4d596f4d7fb9
|
7
|
+
data.tar.gz: fe882a24c6b6c5dd54fa008e3adb7d5c95365eaa9ab014c621cc3046896ea9e7db622882d47803d062398b271d60766785aaee36737e0ee59bcc0270a3779379
|
@@ -61,23 +61,24 @@ class @SortableLabel
|
|
61
61
|
$(@target).each(->
|
62
62
|
stepCount = 1
|
63
63
|
$(this).find(target).each( ->
|
64
|
-
if _this.options['
|
65
|
-
|
66
|
-
|
67
|
-
$(this).closest('.fields').find('.remove_nested_fields').show();
|
68
|
-
$(this).closest('.fields').find(_this.options['positionTarget']).val(stepCount)
|
69
|
-
if typeof(_this.options['label']) == 'string'
|
70
|
-
if _this.options['label'].trim() == 'Day'
|
71
|
-
$(this).closest('.fields').find(_this.options['labelTarget']).html(_this.dayOfWeek(stepCount - 1))
|
64
|
+
if($(this).closest('.fields').siblings().find('.remove_nested_fields').data('association') == _this.options['fieldName'])
|
65
|
+
if _this.options['minimun'] >= stepCount
|
66
|
+
$(this).closest('.fields').find('.remove_nested_fields').hide();
|
72
67
|
else
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
$(this).closest('.fields').find('.remove_nested_fields').show();
|
69
|
+
$(this).closest('.fields').find(_this.options['positionTarget']).val(stepCount)
|
70
|
+
if typeof(_this.options['label']) == 'string'
|
71
|
+
if _this.options['label'].trim() == 'Day'
|
72
|
+
$(this).closest('.fields').find(_this.options['labelTarget']).html(_this.dayOfWeek(stepCount - 1))
|
76
73
|
else
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
74
|
+
if _this.options['fieldName']
|
75
|
+
if $(this).parent().find('.remove_nested_fields').data('association') == _this.options['fieldName']
|
76
|
+
$(this).closest('.fields').find(_this.options['labelTarget']).html(_this.options['label'] + stepCount)
|
77
|
+
else
|
78
|
+
alert("Field name can't be empty!")
|
79
|
+
else if typeof(_this.options['label']) == 'function'
|
80
|
+
$(this).closest('.fields').find(_this.options['labelTarget']).html(_this.options['label'].call($(this).closest('.fields').find(_this.options['labelTarget']), stepCount))
|
81
|
+
stepCount += 1
|
81
82
|
)
|
82
83
|
)
|
83
84
|
|
@@ -86,27 +87,30 @@ class @SortableLabel
|
|
86
87
|
week_group_label_list = []
|
87
88
|
$(@target).each(->
|
88
89
|
$(this).find(target).each(->
|
89
|
-
tempLabel = $(this).text()
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
90
|
+
tempLabel = $(this).closest('.fields').find('.workout_workout_weeks_workout_week_group_id select').find(":selected").text()
|
91
|
+
if $(this).closest('.fields').find('.workout_workout_weeks_workout_week_group_id select').find(":selected").val() != ""
|
92
|
+
_index = _this.isIncludeWeekGroup(tempLabel, week_group_label_list)
|
93
|
+
if _index is -1
|
94
|
+
week_group_label_list.push(
|
95
|
+
name: tempLabel,
|
96
|
+
count: 1
|
97
|
+
)
|
98
|
+
if typeof _this.options['subPositionTarget'] == 'string'
|
99
|
+
$(this).closest('.fields').find(_this.options['subPositionTarget']).val(1)
|
100
|
+
if typeof _this.options['groupLabel'] == 'string'
|
101
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " 1")
|
102
|
+
else
|
103
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel)
|
104
|
+
else if _index > -1
|
105
|
+
week_group_label_list[_index].count += 1
|
106
|
+
if typeof _this.options['subPositionTarget'] == 'string'
|
107
|
+
$(this).closest('.fields').find(_this.options['subPositionTarget']).val(week_group_label_list[_index].count)
|
108
|
+
if typeof _this.options['groupLabel'] == 'string'
|
109
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + _this.options['groupLabel'] + " " + week_group_label_list[_index].count)
|
110
|
+
else
|
111
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel)
|
112
|
+
else
|
113
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>")
|
110
114
|
)
|
111
115
|
)
|
112
116
|
|
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.
|
4
|
+
version: '0.9'
|
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-
|
11
|
+
date: 2017-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|