emerson 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Emerson
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -1,4 +1,4 @@
1
- // Emerson.js 0.0.8
1
+ // Emerson.js 0.0.9
2
2
  //
3
3
  // (c) 2012 Corey Innis
4
4
  // Emerson may be freely distributed under the MIT license.
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  // Current version of the library. Keep in sync with `package.json`.
24
- Emerson.VERSION = '0.0.8';
24
+ Emerson.VERSION = '0.0.9';
25
25
 
26
26
  // Reference the base lib (one of jQuery, Zepto or Ender) as $.
27
27
  var $ = Emerson.base = (root.jQuery || root.Zepto || root.ender);
@@ -315,6 +315,9 @@
315
315
  // 'click' : handler
316
316
  // }
317
317
  // },
318
+ // window : { // bind window, for events
319
+ // 'scroll' : handler // fired outside of the view
320
+ // },
318
321
  // 'outlet:name' : { // a custom key to specify a
319
322
  // 'click' : handler // defined outlet as the scope
320
323
  // }
@@ -326,9 +329,9 @@
326
329
  // event argument is unadultered, allowing access to the full set of targets
327
330
  // as defined by the baselib (e.g., jQuery).
328
331
  //
329
- // **Special notes regarding document-bound handlers**:
332
+ // **Special notes regarding document-/window-bound handlers**:
330
333
  //
331
- // Binding an event like `click` (without selector scope) to the document
334
+ // Binding an event like `click` (without selector scope) to document/window
332
335
  // would likely be a bad idea. A more useful (and less costly) use case
333
336
  // would be a sort of pub/sub. For example, view "A" could trigger an event
334
337
  // indicating that it has rendered a new instance, to which "B" (elsewhere)
@@ -343,6 +346,11 @@
343
346
  bind(instance, subkey, subhandler, undefined, $(document));
344
347
  });
345
348
  }
349
+ else if(key === 'window') {
350
+ _.each(handler, function(subhandler, subkey) {
351
+ bind(instance, subkey, subhandler, undefined, $(window));
352
+ });
353
+ }
346
354
  else {
347
355
  _.each(handler, function(subhandler, subkey) {
348
356
  bind(instance, subkey, subhandler, key, binder);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emerson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-19 00:00:00.000000000 Z
12
+ date: 2012-09-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: transcendent views
15
15
  email:
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  requirements: []
61
61
  rubyforge_project:
62
- rubygems_version: 1.8.11
62
+ rubygems_version: 1.8.24
63
63
  signing_key:
64
64
  specification_version: 3
65
65
  summary: emerson believes in the inherent good in...