recordselect 3.7.4 → 3.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/jquery/record_select.js +10 -2
- data/lib/record_select/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbdf2c7003c4eb77443aaddd96671b29756ee3da
|
4
|
+
data.tar.gz: b3e1d915894022a72d0b029783083e773633f13e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f881a49a626168f3b8b228a6cbfac63a2690d525d911dfa6eb64a4879e03871ad0ab428cb010dad7d984ac2065a394bc68130b80e61537ac81e88a1ab2ac3d6d
|
7
|
+
data.tar.gz: f17831ffa7e2eafa13b7e917c1ed0767cd5cfbb90393ebf73cf276737cfeae6cd80667e7a6506e00896e40780a06c53aeffb4199bc547e69ab7a569746aa2e45
|
@@ -110,6 +110,12 @@ jQuery(document).ready(function() {
|
|
110
110
|
}
|
111
111
|
return true;
|
112
112
|
});
|
113
|
+
jQuery(document).on('click', '.record-select-option .remove', function(event) {
|
114
|
+
var line = jQuery(this).parent(), value = line.find(':input:hidden').val();
|
115
|
+
line.parent().data('recordselect').obj.trigger('recordselect:remove', [value]);
|
116
|
+
line.remove();
|
117
|
+
return false;
|
118
|
+
});
|
113
119
|
jQuery(document).on('ajax:beforeSend', '.record-select-container', function(event, xhr) {
|
114
120
|
var rs = jQuery(this).data('recordselect'), cur = rs.current_xhr;
|
115
121
|
rs.current_xhr = xhr;
|
@@ -550,6 +556,7 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
550
556
|
// decide where the <li> entries should be placed
|
551
557
|
if (this.options.list) this.list_container = jQuery(this.options.list);
|
552
558
|
else this.list_container = this.obj.siblings('ul');
|
559
|
+
this.list_container.data('recordselect', this);
|
553
560
|
|
554
561
|
// take the input name from the text input, and store it for this.add()
|
555
562
|
this.input_name = this.obj.attr('name');
|
@@ -566,6 +573,7 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
566
573
|
|
567
574
|
onselect: function(id, value, text, item) {
|
568
575
|
this.add(id, value);
|
576
|
+
this.obj.trigger("recordselect:add", [id, value, text, item]);
|
569
577
|
},
|
570
578
|
|
571
579
|
/**
|
@@ -575,8 +583,8 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
575
583
|
// return silently if this value has already been selected
|
576
584
|
if (this.list_container.has('input[value=' + id + ']').length > 0) return;
|
577
585
|
|
578
|
-
var entry = '<li>'
|
579
|
-
+ '<a href="#"
|
586
|
+
var entry = '<li class="record-select-option">'
|
587
|
+
+ '<a href="#" class="remove">remove</a>'
|
580
588
|
+ '<input type="hidden" name="' + this.input_name + '" value="' + id + '" />'
|
581
589
|
+ '<label>' + label + '</label>'
|
582
590
|
+ '</li>';
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recordselect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Cambra
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-06-
|
13
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
102
|
+
rubygems_version: 2.5.1
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: RecordSelect widget as a replacement for massive drop down lists
|