chosen-awesome-rails 1.3.0 → 1.3.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20adbd70c6147d63a340474757a997da8dcdab3
|
4
|
+
data.tar.gz: d05ba52a4084c1862e782827ab5fe62dcbce0df5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a07096b5937d979a0ca1d0c58b747c59e1fb01d632f47e7a0b0d07190015220aefc9fdb5c454d409de4ce733863e4d29f3f009c1239f6919dd9d74579273c9b6
|
7
|
+
data.tar.gz: 05fc79eb02d596380228ab2b9002e19cacab6700a04f29d9aa4572798763d23a2b813d115b795ad2c513ca683f150c60328d7fd3fb5b5d8336d1faeb2cf14490
|
@@ -1,22 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: chosen-awesome-rails 1.
|
2
|
+
# stub: chosen-awesome-rails 1.3.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "chosen-awesome-rails".freeze
|
6
|
-
s.version = "1.3.
|
6
|
+
s.version = "1.3.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["heaven".freeze]
|
11
|
-
s.date = "2017-
|
11
|
+
s.date = "2017-12-14"
|
12
12
|
s.description = "Chosen is a javascript library of select box enhancer for jQuery, integrates with Rails asset pipeline for ease of use.".freeze
|
13
|
-
s.email = ["
|
13
|
+
s.email = ["hello@codeart.us".freeze]
|
14
14
|
s.files = [".gitignore".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE.txt".freeze, "README.md".freeze, "Rakefile".freeze, "chosen-awesome-rails.gemspec".freeze, "lib/chosen-awesome-rails.rb".freeze, "lib/chosen-awesome-rails/engine.rb".freeze, "lib/chosen-awesome-rails/engine3.rb".freeze, "lib/chosen-awesome-rails/version.rb".freeze, "vendor/assets/images/chosen-arrow.gif".freeze, "vendor/assets/javascripts/chosen.coffee".freeze, "vendor/assets/javascripts/chosen/chosen.coffee".freeze, "vendor/assets/javascripts/chosen/multiple.coffee".freeze, "vendor/assets/javascripts/chosen/parser.coffee".freeze, "vendor/assets/javascripts/chosen/single.coffee".freeze, "vendor/assets/stylesheets/chosen.scss".freeze, "vendor/assets/stylesheets/chosen/_bootstrap2.scss".freeze, "vendor/assets/stylesheets/chosen/_bootstrap3.scss".freeze, "vendor/assets/stylesheets/chosen/_default.scss".freeze]
|
15
15
|
s.homepage = "https://github.com/heaven/chosen-awesome-rails".freeze
|
16
|
-
s.rubygems_version = "2.6.
|
16
|
+
s.rubygems_version = "2.6.12".freeze
|
17
17
|
s.summary = "Integrate Chosen javascript library with Rails asset pipeline".freeze
|
18
18
|
|
19
|
-
s.installed_by_version = "2.6.
|
19
|
+
s.installed_by_version = "2.6.12" if s.respond_to? :installed_by_version
|
20
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
s.specification_version = 3
|
@@ -106,6 +106,7 @@ class Chosen
|
|
106
106
|
|
107
107
|
@$dropdown = $("<div />", dropdown_props)
|
108
108
|
@$dropdown.$list = @$dropdown.find("ul").first()
|
109
|
+
@$dropdown.$list.$has_more = $("<li />", class: "chosen-hasmore")
|
109
110
|
@$dropdown.$list.$no_results = $("<li />", class: "chosen-noresults")
|
110
111
|
@$dropdown.$list.suggestion = null
|
111
112
|
|
@@ -285,7 +286,7 @@ class Chosen
|
|
285
286
|
|
286
287
|
@$dropdown.bind "mouseover", "li.chosen-option", (evt) => @dropdown_mouseover(evt)
|
287
288
|
@$dropdown.bind "mousedown", "li.chosen-option", (evt) => @dropdown_mousedown(evt)
|
288
|
-
@$dropdown.bind "mousewheel DOMMouseScroll",
|
289
|
+
@$dropdown.bind "mousewheel DOMMouseScroll scroll", (evt) => @dropdown_scroll(evt)
|
289
290
|
|
290
291
|
@$container.addClass("opened")
|
291
292
|
@$dropdown.addClass("opened")
|
@@ -297,6 +298,7 @@ class Chosen
|
|
297
298
|
|
298
299
|
@$container.removeClass("opened")
|
299
300
|
@$dropdown.removeClass("opened")
|
301
|
+
@$dropdown.$list.$has_more.unbind()
|
300
302
|
@$dropdown.unbind "mouseover mousedown mousewheel DOMMouseScroll"
|
301
303
|
@$dropdown.remove()
|
302
304
|
@opened = false
|
@@ -339,20 +341,21 @@ class Chosen
|
|
339
341
|
return
|
340
342
|
|
341
343
|
dropdown_scroll: (evt) ->
|
342
|
-
delta
|
344
|
+
delta = evt.originalEvent.wheelDelta || -evt.originalEvent.detail
|
345
|
+
bottom = @$dropdown.$list[0].scrollHeight - @$dropdown.scrollTop() <= @$dropdown.innerHeight()
|
346
|
+
top = @$dropdown.scrollTop() <= 0
|
343
347
|
|
344
|
-
if (delta < 0 and
|
348
|
+
if delta and ((delta < 0 and bottom) or (delta > 0 and top))
|
345
349
|
evt.preventDefault()
|
346
350
|
evt.stopImmediatePropagation()
|
347
|
-
|
348
|
-
# Try pulling next pages
|
349
|
-
if @ajax
|
350
|
-
@pull_next_page()
|
351
|
-
|
352
|
-
else if (delta > 0 and @$dropdown.scrollTop() <= 0)
|
351
|
+
else if delta and delta > 0 and top
|
353
352
|
evt.preventDefault()
|
354
353
|
evt.stopImmediatePropagation()
|
355
354
|
|
355
|
+
# Try pulling next pages when at bottom
|
356
|
+
if bottom
|
357
|
+
@pull_next_page()
|
358
|
+
|
356
359
|
return
|
357
360
|
|
358
361
|
keydown: (evt) ->
|
@@ -448,6 +451,9 @@ class Chosen
|
|
448
451
|
|
449
452
|
if @parser.selectable_options.length
|
450
453
|
@$dropdown.$list.html(@parser.to_html())
|
454
|
+
|
455
|
+
if @ajax and @ajax.has_more isnt false
|
456
|
+
@show_has_more()
|
451
457
|
else
|
452
458
|
@show_no_results()
|
453
459
|
|
@@ -472,6 +478,11 @@ class Chosen
|
|
472
478
|
else if @$dropdown.$list.suggestion
|
473
479
|
@$dropdown.$list.suggestion = null
|
474
480
|
|
481
|
+
show_has_more: ->
|
482
|
+
@$dropdown.$list.$has_more.text(@locale.has_more)
|
483
|
+
@$dropdown.$list.append(@$dropdown.$list.$has_more)
|
484
|
+
@$dropdown.$list.$has_more.one "click", => @pull_next_page()
|
485
|
+
|
475
486
|
show_no_results: ->
|
476
487
|
text = if @ajax then @locale.start_typing else @locale.no_results
|
477
488
|
|
@@ -639,6 +650,7 @@ class Chosen
|
|
639
650
|
no_results: "No results found"
|
640
651
|
start_typing: "Please start typing"
|
641
652
|
add_new: "add new"
|
653
|
+
has_more: "Load more options"
|
642
654
|
|
643
655
|
@pool: []
|
644
656
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chosen-awesome-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- heaven
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -83,7 +83,7 @@ dependencies:
|
|
83
83
|
description: Chosen is a javascript library of select box enhancer for jQuery, integrates
|
84
84
|
with Rails asset pipeline for ease of use.
|
85
85
|
email:
|
86
|
-
-
|
86
|
+
- hello@codeart.us
|
87
87
|
executables: []
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|