sortable-rails 1.4.2.1 → 1.4.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78756c7fc09d9830ebd40dd4b7171301d1526779
4
- data.tar.gz: 8f99d9b89bbdec242c7decb1c4afdd829b5d2882
3
+ metadata.gz: fd853657326f8127ef3e680b70f90075d8e36ed3
4
+ data.tar.gz: 1b7845309533cd85c8c832557595cd481184bbfb
5
5
  SHA512:
6
- metadata.gz: c83d975e82a07acf27b1da06a076dc526adec2b2b06267c0c9430948a64b9f632a4d6c4f118e1230a655d769add7e7df9efd6dbeff629c1d4ce419dbc16d87f9
7
- data.tar.gz: 715ad433a65259c5a713ee422f87ede2f1035b4a35ab7ac8408f7e0ad750da107570586650dc3a2d23b46c0ee6614078a285a140c0672f0238b1c0b2eb04a071
6
+ metadata.gz: 65df03b494dc17eab02af35997494d5e5ca3a50e37758432a0a7ca450af5a428b6de1206ce37d49eedfa9b64a63d797eaad87a35f450c77dc78f5c961be88893
7
+ data.tar.gz: d8a7b289d40bb6b701d14f7238aca270b9910ea02946733508818460b98bee36cc3ce90b12a11408d92ae20054a5be9c716d186f0e29450f348d3a91d697ef4a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Sortable::Rails
2
2
 
3
- This gem packages the https://github.com/RubaXa/Sortable for Rails's assets pipeline
3
+ This gem packages the https://github.com/RubaXa/Sortable for Rails's assets pipeline
4
4
 
5
5
  Sortable is a minimalist JavaScript library for reorderable drag-and-drop lists.
6
6
 
@@ -14,22 +14,30 @@ gem 'sortable-rails'
14
14
 
15
15
  And then execute:
16
16
 
17
- ```
17
+ ```
18
18
  $ bundle install
19
19
  ```
20
20
 
21
21
  In app/assets/javascripts/application.js, you should add as follows:
22
22
 
23
- ```
23
+ ```
24
24
  //= require ...
25
25
  //= require sortable-rails
26
26
  //= require_tree .
27
27
  ```
28
28
 
29
+ Or with jQuery bindings.
30
+
31
+ ```
32
+ //= require ...
33
+ //= require sortable-rails-jquery
34
+ //= require_tree .
35
+ ```
36
+
29
37
  ## Usage
30
38
 
31
39
  See https://github.com/RubaXa/Sortable
32
40
 
33
41
  ## License
34
42
 
35
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
43
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -1,5 +1,5 @@
1
1
  module Sortable
2
2
  module Rails
3
- VERSION = "1.4.2.1"
3
+ VERSION = "1.4.2.2"
4
4
  end
5
5
  end
@@ -0,0 +1,2 @@
1
+ //=require ../sortable-rails/Sortable.js
2
+ //=require ./jquery.binding.js
@@ -0,0 +1,61 @@
1
+ /**
2
+ * jQuery plugin for Sortable
3
+ * @author RubaXa <trash@rubaxa.org>
4
+ * @license MIT
5
+ */
6
+ (function (factory) {
7
+ "use strict";
8
+
9
+ if (typeof define === "function" && define.amd) {
10
+ define(["jquery"], factory);
11
+ }
12
+ else {
13
+ /* jshint sub:true */
14
+ factory(jQuery);
15
+ }
16
+ })(function ($) {
17
+ "use strict";
18
+
19
+
20
+ /* CODE */
21
+
22
+
23
+ /**
24
+ * jQuery plugin for Sortable
25
+ * @param {Object|String} options
26
+ * @param {..*} [args]
27
+ * @returns {jQuery|*}
28
+ */
29
+ $.fn.sortable = function (options) {
30
+ var retVal,
31
+ args = arguments;
32
+
33
+ this.each(function () {
34
+ var $el = $(this),
35
+ sortable = $el.data('sortable');
36
+
37
+ if (!sortable && (options instanceof Object || !options)) {
38
+ sortable = new Sortable(this, options);
39
+ $el.data('sortable', sortable);
40
+ }
41
+
42
+ if (sortable) {
43
+ if (options === 'widget') {
44
+ return sortable;
45
+ }
46
+ else if (options === 'destroy') {
47
+ sortable.destroy();
48
+ $el.removeData('sortable');
49
+ }
50
+ else if (typeof sortable[options] === 'function') {
51
+ retVal = sortable[options].apply(sortable, [].slice.call(args, 1));
52
+ }
53
+ else if (options in sortable.options) {
54
+ retVal = sortable.option.apply(sortable, args);
55
+ }
56
+ }
57
+ });
58
+
59
+ return (retVal === void 0) ? this : retVal;
60
+ };
61
+ });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sortable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2.1
4
+ version: 1.4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daryl Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,8 @@ files:
54
54
  - lib/sortable/rails.rb
55
55
  - lib/sortable/rails/version.rb
56
56
  - sortable-rails.gemspec
57
+ - vendor/assets/javascripts/sortable-rails-jquery/index.js
58
+ - vendor/assets/javascripts/sortable-rails-jquery/jquery.binding.js
57
59
  - vendor/assets/javascripts/sortable-rails/Sortable.js
58
60
  - vendor/assets/javascripts/sortable-rails/index.js
59
61
  homepage: https://github.com/otaq/sortable-rails/