recordselect 3.4.3 → 3.4.4
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 +13 -13
- data/lib/record_select/version.rb +1 -1
- 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: d4c5cedccd0ac61f0ed77160cc1d311fa7772720
|
4
|
+
data.tar.gz: 285d9fb1b4d03d03d6e446023089cca2eb8f33bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b8360f5e8634eb83c31205d3771ad427d3cbfa9647d5dca6e1175b1b77e8db9b718c56a45e69f4230bdd9563294402135cb42c52bba20ba07f5dba1b63c51f
|
7
|
+
data.tar.gz: f68faab6f46f587e9e33e58981346dfac3d147e06f00604884159cb75bd44e4dc4dc60ec7914c860043d3291b50c681fdf86e1eee13c56ba737a16019f9e1425
|
@@ -116,13 +116,13 @@ var RecordSelect = new Object();
|
|
116
116
|
RecordSelect.document_loaded = false;
|
117
117
|
|
118
118
|
RecordSelect.select_item = function(item) {
|
119
|
-
var
|
120
|
-
var onselect =
|
119
|
+
var rs = item.closest('.record-select-handler');
|
120
|
+
var onselect = rs.get(0).onselect || rs.attr('onselect');
|
121
121
|
if (typeof onselect != 'function') onselect = eval(onselect);
|
122
122
|
if (onselect) {
|
123
123
|
try {
|
124
124
|
var label = item.find('label').first().text().trim(), text = item.text().trim();
|
125
|
-
onselect(item.attr('id').substr(2), label || text, text,
|
125
|
+
onselect(item.attr('id').substr(2), label || text, text, item);
|
126
126
|
} catch(e) {
|
127
127
|
alert(e);
|
128
128
|
}
|
@@ -173,7 +173,7 @@ RecordSelect.Abstract = Class.extend({
|
|
173
173
|
* the onselect event handler - when someone clicks on a record
|
174
174
|
* --override--
|
175
175
|
*/
|
176
|
-
onselect: function(id, value, text) {
|
176
|
+
onselect: function(id, value, text, item) {
|
177
177
|
alert(id + ': ' + value);
|
178
178
|
},
|
179
179
|
|
@@ -391,8 +391,8 @@ RecordSelect.Dialog = RecordSelect.Abstract.extend({
|
|
391
391
|
if (this.onkeypress) this.obj.keypress(jQuery.proxy(this, 'onkeypress'));
|
392
392
|
},
|
393
393
|
|
394
|
-
onselect: function(id, value, text) {
|
395
|
-
if (this.options.onselect(id, value, text) != false) this.close();
|
394
|
+
onselect: function(id, value, text, item) {
|
395
|
+
if (this.options.onselect(id, value, text, item) != false) this.close();
|
396
396
|
},
|
397
397
|
|
398
398
|
toggle: function(e) {
|
@@ -434,10 +434,10 @@ RecordSelect.Single = RecordSelect.Abstract.extend({
|
|
434
434
|
if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers
|
435
435
|
},
|
436
436
|
|
437
|
-
onselect: function(id, value, text) {
|
437
|
+
onselect: function(id, value, text, item) {
|
438
438
|
this.set(id, value);
|
439
|
-
if (this.options.onchange) this.options.onchange.call(this, id, value, text);
|
440
|
-
this.obj.trigger("recordselect:change", [id, value, text]);
|
439
|
+
if (this.options.onchange) this.options.onchange.call(this, id, value, text, item);
|
440
|
+
this.obj.trigger("recordselect:change", [id, value, text, item]);
|
441
441
|
this.close();
|
442
442
|
},
|
443
443
|
|
@@ -477,10 +477,10 @@ RecordSelect.Autocomplete = RecordSelect.Abstract.extend({
|
|
477
477
|
RecordSelect.Abstract.prototype.close.call(this);
|
478
478
|
},
|
479
479
|
|
480
|
-
onselect: function(id, value, text) {
|
480
|
+
onselect: function(id, value, text, item) {
|
481
481
|
this.set(value);
|
482
|
-
if (this.options.onchange) this.options.onchange.call(this, id, value, text);
|
483
|
-
this.obj.trigger("recordselect:change", [id, value, text]);
|
482
|
+
if (this.options.onchange) this.options.onchange.call(this, id, value, text, item);
|
483
|
+
this.obj.trigger("recordselect:change", [id, value, text, item]);
|
484
484
|
this.close();
|
485
485
|
},
|
486
486
|
|
@@ -522,7 +522,7 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
522
522
|
if (this.obj.focused) this.open(); // if it was focused before we could attach observers
|
523
523
|
},
|
524
524
|
|
525
|
-
onselect: function(id, value, text) {
|
525
|
+
onselect: function(id, value, text, item) {
|
526
526
|
this.add(id, value);
|
527
527
|
},
|
528
528
|
|
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.
|
4
|
+
version: 3.4.4
|
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:
|
13
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: shoulda
|