jquery-atwho-rails 0.2.2 → 0.2.3

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.
data/changelog.md CHANGED
@@ -1,3 +1,4 @@
1
+ * 2013.3.12 - v0.2.3 fix some bugs
1
2
  * 2013.3.1 - v0.2.2 fix some bugs.
2
3
  * 2013.1.24 updated to v0.2.0.
3
4
  * 2012.7.1 remove the mirror(copy) element of the textarea(inputor) which will disturb css style. increase timeout of displaying the result list view.
@@ -119,7 +119,11 @@
119
119
  var item, results, text, _i, _len;
120
120
  if (!query) {
121
121
  return items.sort(function(a, b) {
122
- return a[search_key].toLowerCase() > b[search_key].toLowerCase();
122
+ if (a[search_key].toLowerCase() > b[search_key].toLowerCase()) {
123
+ return 1;
124
+ } else {
125
+ return -1;
126
+ }
123
127
  });
124
128
  }
125
129
  results = [];
@@ -201,8 +205,12 @@
201
205
  return this.$inputor.trigger("" + name + ".atwho", data);
202
206
  };
203
207
 
204
- Controller.prototype.data = function() {
205
- return this.get_opt("data");
208
+ Controller.prototype.data = function(data) {
209
+ if (data) {
210
+ return this.$inputor.data("atwho-data", data);
211
+ } else {
212
+ return this.$inputor.data("atwho-data");
213
+ }
206
214
  };
207
215
 
208
216
  Controller.prototype.callbacks = function(func_name) {
@@ -370,6 +378,7 @@
370
378
  search_key = this.get_opt("search_key");
371
379
  data = this.callbacks("sorter").call(this, this.query.text, data, search_key);
372
380
  data = data.splice(0, this.get_opt('limit'));
381
+ this.data(data);
373
382
  return this.view.render(data);
374
383
  };
375
384
 
@@ -380,10 +389,7 @@
380
389
  limit: this.get_opt("limit")
381
390
  };
382
391
  _callback = function(data) {
383
- this.reg(this.current_flag, {
384
- data: data
385
- });
386
- return this.render_view(this.data());
392
+ return this.render_view(data);
387
393
  };
388
394
  _callback = $.proxy(_callback, this);
389
395
  return this.callbacks('remote_filter').call(this, params, data, _callback);
@@ -395,7 +401,7 @@
395
401
  if (!query) {
396
402
  return false;
397
403
  }
398
- data = this.data();
404
+ data = this.get_opt("data");
399
405
  search_key = this.get_opt("search_key");
400
406
  if (typeof data === "string") {
401
407
  this.remote_call(data, query);
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Atwho
3
3
  module Rails
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-atwho-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-02 00:00:00.000000000 Z
12
+ date: 2013-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  segments:
79
79
  - 0
80
- hash: -2700002809925972358
80
+ hash: 2621611205670378736
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  none: false
83
83
  requirements:
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  segments:
88
88
  - 0
89
- hash: -2700002809925972358
89
+ hash: 2621611205670378736
90
90
  requirements: []
91
91
  rubyforge_project: jquery-atwho-rails
92
92
  rubygems_version: 1.8.24