selectivity-rails 0.1.3 → 0.1.4
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 +4 -4
- data/lib/selectivity/rails/version.rb +1 -1
- data/lib/selectivity/rspec.rb +1 -2
- data/vendor/assets/javascripts/selectivity.js +17 -11
- 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: c72d93809502d208c84e3646a8bd9a6038e8ec94
|
4
|
+
data.tar.gz: 01af9c1cf98f7168edbf04478c6a418827f886c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6544d7e3140e111b5db9a6203a7f24e4e6b82dff755fa7330bde3c473d754469eca1efeaff133b187eab061b0dde8d9394f24bb046d4dacdadecac8b66d33d84
|
7
|
+
data.tar.gz: 55f4746e34b60d7bed02af63c215cba5a7aaae845b60493e37f827829f4d524d5ac7b7fc4e00c6be2dd6a912768b987fd8cb8f92acc0d93cdb7525ed4215a728
|
data/lib/selectivity/rspec.rb
CHANGED
@@ -52,8 +52,7 @@ module Selectivity
|
|
52
52
|
input.click
|
53
53
|
|
54
54
|
within 'div.selectivity-dropdown' do
|
55
|
-
|
56
|
-
if find(:xpath, "//div[@class='selectivity-result-item'][contains(text(), '#{item}')]").visible?
|
55
|
+
if find('div.selectivity-result-item', text: item).visible?
|
57
56
|
page.evaluate_script("$('div.selectivity-result-item:contains(#{item})').trigger('click')")
|
58
57
|
end
|
59
58
|
end
|
@@ -303,7 +303,7 @@ var latestQueryNum = 0;
|
|
303
303
|
Selectivity.OptionListeners.push(function(selectivity, options) {
|
304
304
|
|
305
305
|
var query = options.query;
|
306
|
-
if (query) {
|
306
|
+
if (query && !query._async) {
|
307
307
|
options.query = function(queryOptions) {
|
308
308
|
latestQueryNum++;
|
309
309
|
var queryNum = latestQueryNum;
|
@@ -322,6 +322,7 @@ Selectivity.OptionListeners.push(function(selectivity, options) {
|
|
322
322
|
};
|
323
323
|
query(queryOptions);
|
324
324
|
};
|
325
|
+
options.query._async = true;
|
325
326
|
}
|
326
327
|
});
|
327
328
|
|
@@ -2342,6 +2343,8 @@ function SelectivityDropdown(options) {
|
|
2342
2343
|
*/
|
2343
2344
|
this.selectivity = selectivity;
|
2344
2345
|
|
2346
|
+
this._closed = false;
|
2347
|
+
|
2345
2348
|
this._closeProxy = this.close.bind(this);
|
2346
2349
|
if (selectivity.options.closeOnSelect !== false) {
|
2347
2350
|
selectivity.$el.on('selectivity-selecting', this._closeProxy);
|
@@ -2400,17 +2403,21 @@ $.extend(SelectivityDropdown.prototype, EventDelegator.prototype, {
|
|
2400
2403
|
*/
|
2401
2404
|
close: function() {
|
2402
2405
|
|
2403
|
-
if (this.
|
2404
|
-
this.
|
2405
|
-
}
|
2406
|
+
if (!this._closed) {
|
2407
|
+
this._closed = true;
|
2406
2408
|
|
2407
|
-
|
2409
|
+
if (this.options.showSearchInput) {
|
2410
|
+
this.selectivity.removeSearchInput();
|
2411
|
+
}
|
2408
2412
|
|
2409
|
-
|
2413
|
+
this.$el.remove();
|
2410
2414
|
|
2411
|
-
|
2415
|
+
this.removeCloseHandler();
|
2412
2416
|
|
2413
|
-
|
2417
|
+
this.selectivity.$el.off('selectivity-selecting', this._closeProxy);
|
2418
|
+
|
2419
|
+
this.triggerClose();
|
2420
|
+
}
|
2414
2421
|
},
|
2415
2422
|
|
2416
2423
|
/**
|
@@ -2422,8 +2429,7 @@ $.extend(SelectivityDropdown.prototype, EventDelegator.prototype, {
|
|
2422
2429
|
'click .selectivity-load-more': '_loadMoreClicked',
|
2423
2430
|
'click .selectivity-result-item': '_resultClicked',
|
2424
2431
|
'mouseenter .selectivity-load-more': '_loadMoreHovered',
|
2425
|
-
'mouseenter .selectivity-result-item': '_resultHovered'
|
2426
|
-
'mousemove': '_recordMousePosition'
|
2432
|
+
'mouseenter .selectivity-result-item': '_resultHovered'
|
2427
2433
|
},
|
2428
2434
|
|
2429
2435
|
/**
|
@@ -3012,8 +3018,8 @@ function listener(selectivity, $input) {
|
|
3012
3018
|
}
|
3013
3019
|
|
3014
3020
|
var top = position.top;
|
3015
|
-
var elHeight = $el.height();
|
3016
3021
|
var resultsHeight = dropdown.$results.height();
|
3022
|
+
var elHeight = ($el.outerHeight ? $el.outerHeight() : $el.height());
|
3017
3023
|
if (top < 0 || top > resultsHeight - elHeight) {
|
3018
3024
|
top += dropdown.$results.scrollTop();
|
3019
3025
|
dropdown.$results.scrollTop(delta < 0 ? top : top - resultsHeight + elHeight);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selectivity-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konrad Jurkowski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|