recordselect 3.4.1 → 3.4.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 +12 -13
- data/lib/record_select/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a5806d52f09d969c77490fc07f237dbb07fba80
|
4
|
+
data.tar.gz: dcc61e3f7e4a66d708831ab89ea666604382063d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c106d1e35b935492e9c47186090291db6b29f422132a13246c0c233c2a558a691adf1879df6d0d2e53da9d722c9ded69c029ed7c7b54722bc130e3b32165b828
|
7
|
+
data.tar.gz: ea9cd85f28bde943faf972fd482cbc6865e7194b0b11fdc922b27099bc1ebf67ca08025581f5dbf3c4aaf9b58e106929dbea61259d1a8b523dba1b6bf69ce2c1
|
@@ -121,9 +121,8 @@ RecordSelect.select_item = function(item) {
|
|
121
121
|
if (typeof onselect != 'function') onselect = eval(onselect);
|
122
122
|
if (onselect) {
|
123
123
|
try {
|
124
|
-
var label =
|
125
|
-
|
126
|
-
onselect(item.attr('id').substr(2), label, e);
|
124
|
+
var label = item.find('label').first().text().trim(), text = item.text().trim();
|
125
|
+
onselect(item.attr('id').substr(2), label || text, text, e);
|
127
126
|
} catch(e) {
|
128
127
|
alert(e);
|
129
128
|
}
|
@@ -174,7 +173,7 @@ RecordSelect.Abstract = Class.extend({
|
|
174
173
|
* the onselect event handler - when someone clicks on a record
|
175
174
|
* --override--
|
176
175
|
*/
|
177
|
-
onselect: function(id, value) {
|
176
|
+
onselect: function(id, value, text) {
|
178
177
|
alert(id + ': ' + value);
|
179
178
|
},
|
180
179
|
|
@@ -392,8 +391,8 @@ RecordSelect.Dialog = RecordSelect.Abstract.extend({
|
|
392
391
|
if (this.onkeypress) this.obj.keypress(jQuery.proxy(this, 'onkeypress'));
|
393
392
|
},
|
394
393
|
|
395
|
-
onselect: function(id, value) {
|
396
|
-
if (this.options.onselect(id, value) != false) this.close();
|
394
|
+
onselect: function(id, value, text) {
|
395
|
+
if (this.options.onselect(id, value, text) != false) this.close();
|
397
396
|
},
|
398
397
|
|
399
398
|
toggle: function() {
|
@@ -434,10 +433,10 @@ RecordSelect.Single = RecordSelect.Abstract.extend({
|
|
434
433
|
if (this.obj.prop('focused')) this.open(); // if it was focused before we could attach observers
|
435
434
|
},
|
436
435
|
|
437
|
-
onselect: function(id, value) {
|
436
|
+
onselect: function(id, value, text) {
|
438
437
|
this.set(id, value);
|
439
|
-
if (this.options.onchange) this.options.onchange.call(this, id, value);
|
440
|
-
this.obj.trigger("recordselect:change", [id, value]);
|
438
|
+
if (this.options.onchange) this.options.onchange.call(this, id, value, text);
|
439
|
+
this.obj.trigger("recordselect:change", [id, value, text]);
|
441
440
|
this.close();
|
442
441
|
},
|
443
442
|
|
@@ -477,10 +476,10 @@ RecordSelect.Autocomplete = RecordSelect.Abstract.extend({
|
|
477
476
|
RecordSelect.Abstract.prototype.close.call(this);
|
478
477
|
},
|
479
478
|
|
480
|
-
onselect: function(id, value) {
|
479
|
+
onselect: function(id, value, text) {
|
481
480
|
this.set(value);
|
482
|
-
if (this.options.onchange) this.options.onchange.call(this, id, value);
|
483
|
-
this.obj.trigger("recordselect:change", [id, value]);
|
481
|
+
if (this.options.onchange) this.options.onchange.call(this, id, value, text);
|
482
|
+
this.obj.trigger("recordselect:change", [id, value, text]);
|
484
483
|
this.close();
|
485
484
|
},
|
486
485
|
|
@@ -522,7 +521,7 @@ RecordSelect.Multiple = RecordSelect.Abstract.extend({
|
|
522
521
|
if (this.obj.focused) this.open(); // if it was focused before we could attach observers
|
523
522
|
},
|
524
523
|
|
525
|
-
onselect: function(id, value) {
|
524
|
+
onselect: function(id, value, text) {
|
526
525
|
this.add(id, value);
|
527
526
|
},
|
528
527
|
|