jquery-watcher 0.2.0 → 0.3.0

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: 3f9d4a88022661e9f453d660283905ad1d370b1f
4
- data.tar.gz: dd29de9393779f0c343aa1e3e5e1df6481703234
3
+ metadata.gz: 12721398d3d9d15fb67d691a30defa64e9d22f84
4
+ data.tar.gz: cb3ad13148e07691d6067d3d0d74b0119dc00174
5
5
  SHA512:
6
- metadata.gz: fcd5d32d227bdcad3291ffe57b0516bfdd370b747033f0df2248781c675b8dccc03eedfe23026d586650f57eacc7f1b68154c7bdcb384a0d06fb14bd55747d85
7
- data.tar.gz: 4426b8694592cc9367a917de6bd7ef2d50817862e1a05d6087e2ba4217c3462f487992960cc63d56b38100f34b012d3c954c0a5297408f659779279d2d691b56
6
+ metadata.gz: 33581fd3500092ddde5383582a93ab17ceac6b17d3dc797144e75b5823437febf8e4276d1db1e2de21314e1f23e97e04b5a95e7c6780f174e19e76507d3a91a8
7
+ data.tar.gz: 757b1b5b1635c602cb8a76fb9113db0a2f363c56105bc7ba1e34eb524355cf6da5912a72067ea15bc05206d59c303f4b1753ed5df7ff7fa83fbfc0a7c37f975f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.3.0 (2017-02-03)
4
+ ### Changes
5
+ - Prefilter callback elements
6
+
3
7
  ## 0.2.0 (2017-01-31)
4
8
  ### Changes
5
9
  - Refactored to a more future-proof api
@@ -5,22 +5,23 @@ class @JqueryWatcher
5
5
  id = Math.floor(Math.random() * 10000000000000001)
6
6
 
7
7
  register = (element) ->
8
+ return unless element.length
8
9
  return if element.data('jquery-watcher-id-' + id + '-watching') == 'true'
9
10
 
10
11
  element.data(('jquery-watcher-id-' + id + '-watching'), 'true')
11
12
 
12
- callback(element)
13
+ $.each(element, callback)
13
14
 
14
15
  $(document).ready ->
15
- register($(selector))
16
+ $(selector).each ->
17
+ register($(this))
16
18
 
17
19
  document.addEventListener 'turbolinks:load', ->
18
- register($(selector))
20
+ $(selector).each ->
21
+ register($(this))
19
22
 
20
23
  this.observer.add selector, (node) ->
21
- element = $(node)
22
-
23
- register(element)
24
+ register($(node))
24
25
 
25
26
 
26
27
  jQuery['watcher'] = new JqueryWatcher
@@ -1,5 +1,5 @@
1
1
  module Jquery
2
2
  module Watcher
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-watcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Schwab
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails