mwheelintent-rails 1.2.1 → 1.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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDA3Y2RhYzQ2ZmExZjY3MGNmZGViMWNiMjc1MjExZjUyYjE2NzhkYw==
4
+ ZDVhMTM2MmQ3ZGFiNzNmYjRmMmY1NzVhNjNhYjdjODM4NThjZmJiMA==
5
5
  data.tar.gz: !binary |-
6
- NGFmNTFmZmNhMTBiZmRhOWIxNDRjZTJiYTdlZDg1NTg0NDZiNWEzYQ==
6
+ YjE0NThlYjg2NzJmYjk5MTk2ZWU1YTZlNzE1ZDBlZDgyNjI0NTI4ZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmM1MmIxNjUyZWNiYzdmMmY0Nzk5Yjk5MDJkYjBkOGI0OTg5MmVhN2M2MmFi
10
- YTM2ODhhZjE5MjUzYjVlYjhhZjhhZTNhNzdhYzQ4NTBlMmE2Yzk3MTZkODEw
11
- NGJmOGZmOWEwZTIxMjA1NmFhYTg3YTAzODE3MTM4MWZlZWRlNzQ=
9
+ NDYzMGViNDVhMmE0MDY3MmJhNWM2NGY5NjM0YWUwZWU3MjhhNzhmODhhNWEy
10
+ ZGVjYzhjYmNlMTNlYTZjYmVkOGM3MDUxYjQxMTliMGI3OGMwZjhmYjFiOWQ1
11
+ ZGI4ZGQyNjExODc2NTBmZDUwZGNkZDcxZWZmN2Q3ODQ3ZmEyYWQ=
12
12
  data.tar.gz: !binary |-
13
- YzgzMzg4YWE4MzRkMDBhYjI5NTkyMDRhODIyMmYxMzc3ZTU2NTg1YjZiNDIw
14
- N2U3M2IxZWY1NDFkMGFhZTRjMmMxOGQxNTIwZGRjODQ4M2E4YzdmODMzYmMw
15
- ZmFkMmM1MmNkMmE0YTc4Mzk1MGEyYzBjOTBjNjY3ZjEwNGI0Yjc=
13
+ NjY5MThiNjgxZTQ5ODMwM2EwMjU4NGRkNjRkZGQ1NjcyNDU0ODgzZjk3NDYz
14
+ YWI1MmI0ODFiN2NkZWFkOGNjMWFjODAzNDhlMjgyYzk4OTQyODA1ZjQ2ZTY2
15
+ YjdlOTBiODQxZjNkNjFjMGNjZWY2ZjIwZjVlZTFhYWQ0OWQwMTc=
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # jQuery MouseWheel Intent plugin for Rails
2
2
  [![Gem Version](https://badge.fury.io/rb/mwheelintent-rails.png)](http://badge.fury.io/rb/mwheelintent-rails)
3
3
 
4
- A ruby gem that uses the Rails asset pipeline to include the jQuery MouseWheel Intent plugin by trixta.
4
+ A ruby gem that uses the Rails asset pipeline to include the jQuery MouseWheel Intent plugin by trixta and bodrovis.
5
5
 
6
6
  ## Installation
7
7
 
@@ -1,5 +1,5 @@
1
1
  module MWheelIntent
2
2
  module Rails
3
- VERSION = "1.2.1"
3
+ VERSION = "1.3"
4
4
  end
5
5
  end
@@ -1,9 +1,8 @@
1
1
  /**
2
- * @author trixta
3
- * @version 1.2
2
+ * @author trixta and bodrovis
3
+ * @version 1.3
4
4
  */
5
5
  (function($){
6
-
7
6
  var mwheelI = {
8
7
  pos: [-260, -260]
9
8
  },
@@ -23,24 +22,25 @@
23
22
  }
24
23
 
25
24
  $.event.special.mwheelIntent = {
26
- setup: function(){
27
- var jElm = $(this).bind('mousewheel', $.event.special.mwheelIntent.handler);
25
+ setup: function() {
26
+ var jElm = $(this).on('mousewheel', $.event.special.mwheelIntent.handler);
28
27
  if( this !== doc && this !== root && this !== body ){
29
- jElm.bind('mouseleave', unsetPos);
28
+ jElm.on('mouseleave', unsetPos);
30
29
  }
31
30
  jElm = null;
32
31
  return true;
33
32
  },
34
33
  teardown: function(){
35
34
  $(this)
36
- .unbind('mousewheel', $.event.special.mwheelIntent.handler)
37
- .unbind('mouseleave', unsetPos)
35
+ .off('mousewheel', $.event.special.mwheelIntent.handler)
36
+ .off('mouseleave', unsetPos)
38
37
  ;
39
38
  return true;
40
39
  },
41
- handler: function(e, d){
40
+ handler: function(e, d) {
42
41
  var pos = [e.clientX, e.clientY];
43
- if( this === mwheelI.elem || Math.abs(mwheelI.pos[0] - pos[0]) > minDif || Math.abs(mwheelI.pos[1] - pos[1]) > minDif ){
42
+ if( this === mwheelI.elem || Math.abs(mwheelI.pos[0] - pos[0]) > minDif ||
43
+ Math.abs(mwheelI.pos[1] - pos[1]) > minDif ) {
44
44
  mwheelI.elem = this;
45
45
  mwheelI.pos = pos;
46
46
  minDif = 250;
@@ -58,19 +58,20 @@
58
58
  }
59
59
  }
60
60
  };
61
+
61
62
  $.fn.extend({
62
63
  mwheelIntent: function(fn) {
63
- return fn ? this.bind("mwheelIntent", fn) : this.trigger("mwheelIntent");
64
+ return fn ? this.on("mwheelIntent", fn) : this.trigger("mwheelIntent");
64
65
  },
65
66
 
66
67
  unmwheelIntent: function(fn) {
67
- return this.unbind("mwheelIntent", fn);
68
+ return this.off("mwheelIntent", fn);
68
69
  }
69
70
  });
70
71
 
71
72
  $(function(){
72
73
  body = doc.body;
73
74
  //assume that document is always scrollable, doesn't hurt if not
74
- $(doc).bind('mwheelIntent.mwheelIntentDefault', $.noop);
75
+ $(doc).on('mwheelIntent.mwheelIntentDefault', $.noop);
75
76
  });
76
77
  })(jQuery);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mwheelintent-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Bodrov