vertebra 0.1.2 → 0.1.4

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
- SHA1:
3
- metadata.gz: 4dd9258b8b224cd0513400c8a8ea83fe43362a2d
4
- data.tar.gz: d1a97fcd7ff3e7b1a55468f40ee139f574c432c9
2
+ SHA256:
3
+ metadata.gz: 7b929a80be4f01775d2e8bf79153b679d20888127f8f86c9c9f62b086a56dd69
4
+ data.tar.gz: 732618286d310fd7f447f31947b107a09a58464fde13fc6d2a3c88f23a091030
5
5
  SHA512:
6
- metadata.gz: 1b79a24e376ece8a56e91ddcff79da0b46f125b0a56d867470ff8218a3b5cdd4972c4b269071de0daab47e459b3644439357f3fe2bad07089e73693527bb05b0
7
- data.tar.gz: 81d8ac00f05c7d18c5cf28201da010165c02fb4d5ec8e58a80ccd48b719093bef421249f5ec0272e38b64f8b84748ce503dad655f5cc96b71f3c29aa1a0be50e
6
+ metadata.gz: 49aa20cf8ed7a3a1353b8f7bfc112e579e2de45b679ad107d85a4776c148602ab5c406b4a862dc7dfd0b252af95740b666fb2f422da170b8b1ca533128bac945
7
+ data.tar.gz: 500733bd8164b220e4b2ce2a4996137a59fbe561fe377d4cae9fc21202c8e92a96bca749f998dc056b8e4087d7f5d63866860c82da2d7c356fb8cf4330086111
@@ -15,6 +15,9 @@ delegateEventSplitter = /^(\S+)\s*(.*)$/
15
15
  @trim = (str) ->
16
16
  str.replace(/^\s+|\s+$/g, '')
17
17
 
18
+ @isFunction = (obj) ->
19
+ !!(obj and obj.constructor and obj.call and obj.apply)
20
+
18
21
  _now = Date.now || -> new Date().getTime()
19
22
 
20
23
  # Throttle function borrowed from underscore.js
@@ -72,10 +75,12 @@ class Vertebra.View
72
75
  @delegateEvents()
73
76
 
74
77
  delegateEvents: ->
75
- return unless @events
76
78
  @_undelegateEvents()
79
+ return unless @events
80
+
81
+ events = if isFunction(@events) then @events() else @events
77
82
 
78
- for key, method of @events
83
+ for key, method of events
79
84
  method = @[method]
80
85
  continue unless method
81
86
  match = key.match(delegateEventSplitter)
@@ -1,3 +1,3 @@
1
1
  module Vertebra
2
- VERSION = "0.1.2"
2
+ VERSION = '0.1.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertebra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - vala
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2022-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '3.1'
20
20
  - - "<="
21
21
  - !ruby/object:Gem::Version
22
- version: '6.0'
22
+ version: '8.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '3.1'
30
30
  - - "<="
31
31
  - !ruby/object:Gem::Version
32
- version: '6.0'
32
+ version: '8.0'
33
33
  description: Mico-JS Framework based on the Backbone.View API
34
34
  email:
35
35
  - vala@glyph.fr
@@ -55,7 +55,7 @@ homepage: https://github.com/glyph-fr/vertebra
55
55
  licenses:
56
56
  - MIT
57
57
  metadata: {}
58
- post_install_message:
58
+ post_install_message:
59
59
  rdoc_options: []
60
60
  require_paths:
61
61
  - lib
@@ -70,9 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.6.8
75
- signing_key:
73
+ rubygems_version: 3.3.7
74
+ signing_key:
76
75
  specification_version: 4
77
76
  summary: Mico-JS Framework based on the Backbone.View API
78
77
  test_files: []