emerson 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  transcendent views. (WIP)
4
4
 
5
+ See <http://coreyti.github.com/emerson-js/>
6
+
5
7
  ## Installation
6
8
 
7
9
  Add this line to your application's Gemfile:
@@ -27,3 +29,13 @@ TODO: Write usage instructions here
27
29
  3. Commit your changes (`git commit -am 'Added some feature'`)
28
30
  4. Push to the branch (`git push origin my-new-feature`)
29
31
  5. Create new Pull Request
32
+
33
+ ## Credits
34
+
35
+ * Contributions (roughly chronologically)
36
+ * [Corey Innis](http://github.com/coreyti):<br/>
37
+ Author/maintainer
38
+ * [Rachel Heaton](https://github.com/rheaton):<br/>
39
+ Feedback and bugfixes
40
+ * [Doug Rohrer](https://github.com/JeetKunDoug):<br/>
41
+ Feedback and bugfixes
@@ -1,3 +1,3 @@
1
1
  module Emerson
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -1,10 +1,11 @@
1
- // Emerson.js 0.0.10
1
+ // Emerson.js 0.0.11
2
2
  //
3
3
  // (c) 2012 Corey Innis
4
4
  // Emerson may be freely distributed under the MIT license.
5
5
  // For all details and documentation:
6
6
  // http://coolerator.net
7
7
 
8
+ // = require underscore.js
8
9
  // = require emerson/base.js
9
10
  // = require emerson/util.js
10
11
  // = require emerson/http.js
@@ -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.10';
24
+ Emerson.VERSION = '0.0.11';
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);
@@ -1,5 +1,8 @@
1
1
  // Emerson Sink
2
2
  //
3
+ // "sink - a body or process that acts to absorb or remove energy or a
4
+ // particular component from a system."
5
+ //
3
6
  // Adds...
4
7
 
5
8
  (function(ns) {
@@ -107,17 +110,21 @@
107
110
 
108
111
  // ### process
109
112
  // ...
113
+ // TODO: DRY-up the update code.
110
114
  function process(element, matches) {
111
115
  var parts, strategy, clone;
112
116
 
113
117
  if(matches.length > 1) {
114
- matches.each(function() {
118
+ matches.each(function(current) {
119
+ current = $(this);
115
120
  clone = prepare(element.clone(true));
116
- parts = $(this).data('sink').split(':');
121
+ parts = current.data('sink').split(':');
117
122
  strategy = parts[1] || 'replace';
118
123
 
119
- $(this).trigger('sink:before');
120
- strategies[strategy].call(clone, $(this))
124
+ current.trigger('sink:before');
125
+ strategies[strategy]
126
+ .call(clone, current)
127
+ .each(forceCalculateStyle)
121
128
  .trigger('sink:after');
122
129
 
123
130
  clone.trigger('sink:after');
@@ -128,8 +135,35 @@
128
135
  strategy = parts[1] || 'replace';
129
136
 
130
137
  matches.trigger('sink:before');
131
- strategies[strategy].call(prepare(element), matches)
138
+ strategies[strategy]
139
+ .call(prepare(element), matches)
140
+ .each(forceCalculateStyle)
132
141
  .trigger('sink:after');
133
142
  }
134
143
  }
144
+
145
+ // ### forceCalculateStyle
146
+ //
147
+ // forceCalculateStyle.call(node)
148
+ //
149
+ // Given a DOM node, force style calculation. e.g., this might be useful for
150
+ // establishing a render baseline to enable CSS animations. Note that the
151
+ // particular property accessed is arbitrary.
152
+ //
153
+ // TODO: Add spec coverage (needs pre-/post-render and some CSS transition).
154
+ //
155
+ // Credits:
156
+ //
157
+ // * Doug Rohrer & Rachel Heaton for the bug fix:
158
+ // <https://github.com/coreyti/emerson/pull/9>
159
+ function forceCalculateStyle() {
160
+ if(this.jquery) {
161
+ window.getComputedStyle(this[0]).opacity;
162
+ }
163
+ else {
164
+ window.getComputedStyle(this).opacity;
165
+ }
166
+
167
+ return this;
168
+ }
135
169
  })(Emerson);
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.10
4
+ version: 0.0.11
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-10-17 00:00:00.000000000 Z
12
+ date: 2014-04-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: transcendent views
15
15
  email:
@@ -59,8 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  version: '0'
60
60
  requirements: []
61
61
  rubyforge_project:
62
- rubygems_version: 1.8.24
62
+ rubygems_version: 1.8.23
63
63
  signing_key:
64
64
  specification_version: 3
65
65
  summary: emerson believes in the inherent good in...
66
66
  test_files: []
67
+ has_rdoc: