recordselect 3.4.1 → 3.4.2

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: 097b55b2bcf91b9610442b574be4a9359fbd3828
4
- data.tar.gz: b98335628b3b439807428a33bdc8d03793738255
3
+ metadata.gz: 9a5806d52f09d969c77490fc07f237dbb07fba80
4
+ data.tar.gz: dcc61e3f7e4a66d708831ab89ea666604382063d
5
5
  SHA512:
6
- metadata.gz: e5b2934d61d0cc0a6dbdce8269d4217f169b3dea3af9227effe4e2bad429d340df960f37109b9fc1a93f39eaf3762abf3620937140d002fb5810c528ce3b16ed
7
- data.tar.gz: 3f274babc93311a0a941054be6092910d6d0278e12fbcb5e361149aedc2ca818f29e7a6950a5db8f6784d5a9916aaab7ce7e604b997436c0c90905e2aa420e9a
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 = jQuery.trim(item.find('label').first().text());
125
- if (!label) label = item.text().trim();
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
 
@@ -2,7 +2,7 @@ module RecordSelect
2
2
  module Version
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.1
4
+ version: 3.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra