Avoid unnecessary return values
Showing
3 changed files
with
23 additions
and
33 deletions
... | @@ -161,7 +161,7 @@ | ... | @@ -161,7 +161,7 @@ |
161 | }; | 161 | }; |
162 | 162 | ||
163 | View.prototype.build = function() { | 163 | View.prototype.build = function() { |
164 | var bindingRegExp, el, eventRegExp, iterationRegExp, iterator, node, parseNode, skipNodes, _i, _len, _ref, _results, | 164 | var bindingRegExp, el, eventRegExp, iterationRegExp, iterator, node, parseNode, skipNodes, _i, _j, _len, _len1, _ref, _ref1, |
165 | _this = this; | 165 | _this = this; |
166 | this.bindings = []; | 166 | this.bindings = []; |
167 | skipNodes = []; | 167 | skipNodes = []; |
... | @@ -170,7 +170,7 @@ | ... | @@ -170,7 +170,7 @@ |
170 | eventRegExp = /^on-/; | 170 | eventRegExp = /^on-/; |
171 | iterationRegExp = /^each-/; | 171 | iterationRegExp = /^each-/; |
172 | parseNode = function(node) { | 172 | parseNode = function(node) { |
173 | var a, attribute, binding, context, ctx, dependencies, keypath, model, n, options, path, pipe, pipes, splitPath, type, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _results; | 173 | var a, attribute, binding, context, ctx, dependencies, keypath, model, n, options, path, pipe, pipes, splitPath, type, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2; |
174 | if (__indexOf.call(skipNodes, node) < 0) { | 174 | if (__indexOf.call(skipNodes, node) < 0) { |
175 | _ref = node.attributes; | 175 | _ref = node.attributes; |
176 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { | 176 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
... | @@ -190,31 +190,30 @@ | ... | @@ -190,31 +190,30 @@ |
190 | } | 190 | } |
191 | } | 191 | } |
192 | _ref2 = iterator || node.attributes; | 192 | _ref2 = iterator || node.attributes; |
193 | _results = []; | ||
194 | for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { | 193 | for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { |
195 | attribute = _ref2[_k]; | 194 | attribute = _ref2[_k]; |
196 | if (bindingRegExp.test(attribute.name)) { | 195 | if (bindingRegExp.test(attribute.name)) { |
197 | options = {}; | 196 | options = {}; |
198 | type = attribute.name.replace(bindingRegExp, ''); | 197 | type = attribute.name.replace(bindingRegExp, ''); |
199 | pipes = (function() { | 198 | pipes = (function() { |
200 | var _l, _len3, _ref3, _results1; | 199 | var _l, _len3, _ref3, _results; |
201 | _ref3 = attribute.value.split('|'); | 200 | _ref3 = attribute.value.split('|'); |
202 | _results1 = []; | 201 | _results = []; |
203 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { | 202 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { |
204 | pipe = _ref3[_l]; | 203 | pipe = _ref3[_l]; |
205 | _results1.push(pipe.trim()); | 204 | _results.push(pipe.trim()); |
206 | } | 205 | } |
207 | return _results1; | 206 | return _results; |
208 | })(); | 207 | })(); |
209 | context = (function() { | 208 | context = (function() { |
210 | var _l, _len3, _ref3, _results1; | 209 | var _l, _len3, _ref3, _results; |
211 | _ref3 = pipes.shift().split('>'); | 210 | _ref3 = pipes.shift().split('>'); |
212 | _results1 = []; | 211 | _results = []; |
213 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { | 212 | for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { |
214 | ctx = _ref3[_l]; | 213 | ctx = _ref3[_l]; |
215 | _results1.push(ctx.trim()); | 214 | _results.push(ctx.trim()); |
216 | } | 215 | } |
217 | return _results1; | 216 | return _results; |
218 | })(); | 217 | })(); |
219 | path = context.shift(); | 218 | path = context.shift(); |
220 | splitPath = path.split(/\.|:/); | 219 | splitPath = path.split(/\.|:/); |
... | @@ -244,31 +243,21 @@ | ... | @@ -244,31 +243,21 @@ |
244 | a = iterator[_l]; | 243 | a = iterator[_l]; |
245 | node.removeAttribute(a.name); | 244 | node.removeAttribute(a.name); |
246 | } | 245 | } |
247 | _results.push(iterator = null); | 246 | iterator = null; |
248 | } else { | ||
249 | _results.push(void 0); | ||
250 | } | 247 | } |
251 | } | 248 | } |
252 | return _results; | ||
253 | } | 249 | } |
254 | }; | 250 | }; |
255 | _ref = this.els; | 251 | _ref = this.els; |
256 | _results = []; | ||
257 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { | 252 | for (_i = 0, _len = _ref.length; _i < _len; _i++) { |
258 | el = _ref[_i]; | 253 | el = _ref[_i]; |
259 | parseNode(el); | 254 | parseNode(el); |
260 | _results.push((function() { | 255 | _ref1 = el.getElementsByTagName('*'); |
261 | var _j, _len1, _ref1, _results1; | 256 | for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { |
262 | _ref1 = el.getElementsByTagName('*'); | 257 | node = _ref1[_j]; |
263 | _results1 = []; | 258 | parseNode(node); |
264 | for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { | 259 | } |
265 | node = _ref1[_j]; | ||
266 | _results1.push(parseNode(node)); | ||
267 | } | ||
268 | return _results1; | ||
269 | })()); | ||
270 | } | 260 | } |
271 | return _results; | ||
272 | }; | 261 | }; |
273 | 262 | ||
274 | View.prototype.bind = function() { | 263 | View.prototype.bind = function() { |
... | @@ -436,16 +425,14 @@ | ... | @@ -436,16 +425,14 @@ |
436 | formatters: Rivets.formatters, | 425 | formatters: Rivets.formatters, |
437 | config: Rivets.config, | 426 | config: Rivets.config, |
438 | configure: function(options) { | 427 | configure: function(options) { |
439 | var property, value, _results; | 428 | var property, value; |
440 | if (options == null) { | 429 | if (options == null) { |
441 | options = {}; | 430 | options = {}; |
442 | } | 431 | } |
443 | _results = []; | ||
444 | for (property in options) { | 432 | for (property in options) { |
445 | value = options[property]; | 433 | value = options[property]; |
446 | _results.push(Rivets.config[property] = value); | 434 | Rivets.config[property] = value; |
447 | } | 435 | } |
448 | return _results; | ||
449 | }, | 436 | }, |
450 | bind: function(el, models) { | 437 | bind: function(el, models) { |
451 | var view; | 438 | var view; | ... | ... |
... | @@ -2,4 +2,4 @@ | ... | @@ -2,4 +2,4 @@ |
2 | // version: 0.3.2 | 2 | // version: 0.3.2 |
3 | // author: Michael Richards | 3 | // author: Michael Richards |
4 | // license: MIT | 4 | // license: MIT |
5 | (function(){var a,b,c,d,e,f,g,h,i=function(a,b){return function(){return a.apply(b,arguments)}},j=[].slice,k=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a={},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.Binding=function(){function g(c,e,g,h,j){this.el=c,this.type=e,this.model=g,this.keypath=h,this.options=j!=null?j:{},this.unbind=i(this.unbind,this),this.publish=i(this.publish,this),this.bind=i(this.bind,this),this.set=i(this.set,this),this.formattedValue=i(this.formattedValue,this),this.routine=function(){switch(this.options.special){case"event":return d(this.type);case"iteration":return f(this.type);default:return a.routines[this.type]||b(this.type)}}.call(this),this.formatters=this.options.formatters||[]}return g.prototype.bidirectionals=["value","checked","unchecked"],g.prototype.formattedValue=function(b){var c,d,e,f,g,h,i,k;h=this.formatters;for(f=0,g=h.length;f<g;f++)d=h[f],c=d.split(/\s+/),e=c.shift(),b=this.model[e]instanceof Function?(i=this.model)[e].apply(i,[b].concat(j.call(c))):a.formatters[e]?(k=a.formatters)[e].apply(k,[b].concat(j.call(c))):void 0;return b},g.prototype.set=function(a){return a=this.formattedValue(a),this.options.special==="event"?(this.routine(this.el,a,this.currentListener),this.currentListener=a):this.options.special==="iteration"?this.routine(this.el,a,this):(a instanceof Function&&(a=a.call(this.model)),this.routine(this.el,a))},g.prototype.bind=function(){var b,d,e,f,g,h,i,j=this;this.options.bypass?this.set(this.model[this.keypath]):(a.config.adapter.subscribe(this.model,this.keypath,this.set),a.config.preloadData&&this.set(a.config.adapter.read(this.model,this.keypath)));if((g=this.options.dependencies)!=null?g.length:void 0){this.dependencyCallbacks={},h=this.options.dependencies;for(e=0,f=h.length;e<f;e++)d=h[e],b=this.dependencyCallbacks[d]=function(b){return j.set(j.options.bypass?j.model[j.keypath]:a.config.adapter.read(j.model,j.keypath))},a.config.adapter.subscribe(this.model,d,b)}if(i=this.type,k.call(this.bidirectionals,i)>=0)return c(this.el,"change",this.publish)},g.prototype.publish=function(b){var c;return c=b.target||b.srcElement,a.config.adapter.publish(this.model,this.keypath,e(c))},g.prototype.unbind=function(){var b,c,d,e,f,g,h;if(!this.options.bypass){a.config.adapter.unsubscribe(this.model,this.keypath,this.set);if((f=this.options.dependencies)!=null?f.length:void 0){g=this.options.dependencies;for(d=0,e=g.length;d<e;d++)c=g[d],b=this.dependencyCallbacks[c],a.config.adapter.unsubscribe(this.model,c,b)}if(h=this.type,k.call(this.bidirectionals,h)>=0)return this.el.removeEventListener("change",this.publish)}},g}(),a.View=function(){function b(a,b){this.els=a,this.models=b,this.unbind=i(this.unbind,this),this.bind=i(this.bind,this),this.build=i(this.build,this),this.bindingRegExp=i(this.bindingRegExp,this),this.els.jquery||this.els instanceof Array||(this.els=[this.els]),this.build()}return b.prototype.bindingRegExp=function(){var b;return b=a.config.prefix,b?new RegExp("^data-"+b+"-"):/^data-/},b.prototype.build=function(){var b,c,d,e,f,g,h,i,j,l,m,n,o=this;this.bindings=[],i=[],f=null,b=this.bindingRegExp(),d=/^on-/,e=/^each-/,h=function(c){var g,h,j,l,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J;if(k.call(i,c)<0){G=c.attributes;for(y=0,C=G.length;y<C;y++){h=G[y];if(b.test(h.name)){x=h.name.replace(b,"");if(e.test(x)&&!o.models[x.replace(e,"")]){H=c.getElementsByTagName("*");for(z=0,D=H.length;z<D;z++)r=H[z],i.push(r);f=[h]}}}I=f||c.attributes,J=[];for(A=0,E=I.length;A<E;A++){h=I[A];if(b.test(h.name)){s={},x=h.name.replace(b,""),v=function(){var a,b,c,d;c=h.value.split("|"),d=[];for(a=0,b=c.length;a<b;a++)u=c[a],d.push(u.trim());return d}(),l=function(){var a,b,c,d;c=v.shift().split(">"),d=[];for(a=0,b=c.length;a<b;a++)m=c[a],d.push(m.trim());return d}(),t=l.shift(),w=t.split(/\.|:/),s.formatters=v,q=o.models[w.shift()],s.bypass=t.indexOf(":")!==-1,p=w.join();if(q){if(n=l.shift())s.dependencies=n.split(/\s+/);d.test(x)&&(x=x.replace(d,""),s.special="event"),e.test(x)&&(x=x.replace(e,""),s.special="iteration"),j=new a.Binding(c,x,q,p,s),j.view=o,o.bindings.push(j)}}if(f){for(B=0,F=f.length;B<F;B++)g=f[B],c.removeAttribute(g.name);J.push(f=null)}else J.push(void 0)}return J}},m=this.els,n=[];for(j=0,l=m.length;j<l;j++)c=m[j],h(c),n.push(function(){var a,b,d,e;d=c.getElementsByTagName("*"),e=[];for(a=0,b=d.length;a<b;a++)g=d[a],e.push(h(g));return e}());return n},b.prototype.bind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.bind());return e},b.prototype.unbind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.unbind());return e},b}(),c=function(a,b,c){return window.addEventListener?a.addEventListener(b,c,!1):(b="on"+b,a.attachEvent(b,c))},h=function(a,b,c){return window.removeEventListener?a.removeEventListener(b,c,!1):(b="on"+b,a.detachEvent(b,c))},e=function(a){switch(a.type){case"checkbox":return a.checked;default:return a.value}},d=function(a){return function(b,d,e){d&&c(b,a,d);if(e)return h(b,a,e)}},f=function(a){return function(b,c,d){var e,f,h,i,j,k,l,m,n,o,p,q,r,s;if(d.iterated!=null){q=d.iterated;for(m=0,o=q.length;m<o;m++)i=q[m],i.view.unbind(),i.el.parentNode.removeChild(i.el)}else d.marker=document.createComment(" rivets: each-"+a+" "),b.parentNode.insertBefore(d.marker,b),b.parentNode.removeChild(b);d.iterated=[],s=[];for(n=0,p=c.length;n<p;n++){f=c[n],e={},r=d.view.models;for(k in r)j=r[k],e[k]=j;e[a]=f,h=b.cloneNode(!0),l=d.iterated[d.iterated.length-1]||d.marker,d.marker.parentNode.insertBefore(h,l.nextSibling),s.push(d.iterated.push({el:h,view:g.bind(h,e)}))}return s}},b=function(a){return function(b,c){return c?b.setAttribute(a,c):b.removeAttribute(a)}},a.routines={enabled:function(a,b){return a.disabled=!b},disabled:function(a,b){return a.disabled=!!b},checked:function(a,b){return a.type==="radio"?a.checked=a.value===b:a.checked=!!b},unchecked:function(a,b){return a.type==="radio"?a.checked=a.value!==b:a.checked=!b},show:function(a,b){return a.style.display=b?"":"none"},hide:function(a,b){return a.style.display=b?"none":""},html:function(a,b){return a.innerHTML=b!=null?b:""},value:function(a,b){return a.value=b!=null?b:""},text:function(a,b){return a.innerText!=null?a.innerText=b!=null?b:"":a.textContent=b!=null?b:""}},a.config={preloadData:!0},a.formatters={},g={routines:a.routines,formatters:a.formatters,config:a.config,configure:function(b){var c,d,e;b==null&&(b={}),e=[];for(c in b)d=b[c],e.push(a.config[c]=d);return e},bind:function(b,c){var d;return c==null&&(c={}),d=new a.View(b,c),d.bind(),d}},typeof module!="undefined"&&module!==null?module.exports=g:this.rivets=g}).call(this); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
5 | (function(){var a,b,c,d,e,f,g,h,i=function(a,b){return function(){return a.apply(b,arguments)}},j=[].slice,k=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a={},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),a.Binding=function(){function g(c,e,g,h,j){this.el=c,this.type=e,this.model=g,this.keypath=h,this.options=j!=null?j:{},this.unbind=i(this.unbind,this),this.publish=i(this.publish,this),this.bind=i(this.bind,this),this.set=i(this.set,this),this.formattedValue=i(this.formattedValue,this),this.routine=function(){switch(this.options.special){case"event":return d(this.type);case"iteration":return f(this.type);default:return a.routines[this.type]||b(this.type)}}.call(this),this.formatters=this.options.formatters||[]}return g.prototype.bidirectionals=["value","checked","unchecked"],g.prototype.formattedValue=function(b){var c,d,e,f,g,h,i,k;h=this.formatters;for(f=0,g=h.length;f<g;f++)d=h[f],c=d.split(/\s+/),e=c.shift(),b=this.model[e]instanceof Function?(i=this.model)[e].apply(i,[b].concat(j.call(c))):a.formatters[e]?(k=a.formatters)[e].apply(k,[b].concat(j.call(c))):void 0;return b},g.prototype.set=function(a){return a=this.formattedValue(a),this.options.special==="event"?(this.routine(this.el,a,this.currentListener),this.currentListener=a):this.options.special==="iteration"?this.routine(this.el,a,this):(a instanceof Function&&(a=a.call(this.model)),this.routine(this.el,a))},g.prototype.bind=function(){var b,d,e,f,g,h,i,j=this;this.options.bypass?this.set(this.model[this.keypath]):(a.config.adapter.subscribe(this.model,this.keypath,this.set),a.config.preloadData&&this.set(a.config.adapter.read(this.model,this.keypath)));if((g=this.options.dependencies)!=null?g.length:void 0){this.dependencyCallbacks={},h=this.options.dependencies;for(e=0,f=h.length;e<f;e++)d=h[e],b=this.dependencyCallbacks[d]=function(b){return j.set(j.options.bypass?j.model[j.keypath]:a.config.adapter.read(j.model,j.keypath))},a.config.adapter.subscribe(this.model,d,b)}if(i=this.type,k.call(this.bidirectionals,i)>=0)return c(this.el,"change",this.publish)},g.prototype.publish=function(b){var c;return c=b.target||b.srcElement,a.config.adapter.publish(this.model,this.keypath,e(c))},g.prototype.unbind=function(){var b,c,d,e,f,g,h;if(!this.options.bypass){a.config.adapter.unsubscribe(this.model,this.keypath,this.set);if((f=this.options.dependencies)!=null?f.length:void 0){g=this.options.dependencies;for(d=0,e=g.length;d<e;d++)c=g[d],b=this.dependencyCallbacks[c],a.config.adapter.unsubscribe(this.model,c,b)}if(h=this.type,k.call(this.bidirectionals,h)>=0)return this.el.removeEventListener("change",this.publish)}},g}(),a.View=function(){function b(a,b){this.els=a,this.models=b,this.unbind=i(this.unbind,this),this.bind=i(this.bind,this),this.build=i(this.build,this),this.bindingRegExp=i(this.bindingRegExp,this),this.els.jquery||this.els instanceof Array||(this.els=[this.els]),this.build()}return b.prototype.bindingRegExp=function(){var b;return b=a.config.prefix,b?new RegExp("^data-"+b+"-"):/^data-/},b.prototype.build=function(){var b,c,d,e,f,g,h,i,j,l,m,n,o,p,q=this;this.bindings=[],i=[],f=null,b=this.bindingRegExp(),d=/^on-/,e=/^each-/,h=function(c){var g,h,j,l,m,n,o,p,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I;if(k.call(i,c)<0){G=c.attributes;for(y=0,C=G.length;y<C;y++){h=G[y];if(b.test(h.name)){x=h.name.replace(b,"");if(e.test(x)&&!q.models[x.replace(e,"")]){H=c.getElementsByTagName("*");for(z=0,D=H.length;z<D;z++)r=H[z],i.push(r);f=[h]}}}I=f||c.attributes;for(A=0,E=I.length;A<E;A++){h=I[A];if(b.test(h.name)){s={},x=h.name.replace(b,""),v=function(){var a,b,c,d;c=h.value.split("|"),d=[];for(a=0,b=c.length;a<b;a++)u=c[a],d.push(u.trim());return d}(),l=function(){var a,b,c,d;c=v.shift().split(">"),d=[];for(a=0,b=c.length;a<b;a++)m=c[a],d.push(m.trim());return d}(),t=l.shift(),w=t.split(/\.|:/),s.formatters=v,p=q.models[w.shift()],s.bypass=t.indexOf(":")!==-1,o=w.join();if(p){if(n=l.shift())s.dependencies=n.split(/\s+/);d.test(x)&&(x=x.replace(d,""),s.special="event"),e.test(x)&&(x=x.replace(e,""),s.special="iteration"),j=new a.Binding(c,x,p,o,s),j.view=q,q.bindings.push(j)}}if(f){for(B=0,F=f.length;B<F;B++)g=f[B],c.removeAttribute(g.name);f=null}}}},o=this.els;for(j=0,m=o.length;j<m;j++){c=o[j],h(c),p=c.getElementsByTagName("*");for(l=0,n=p.length;l<n;l++)g=p[l],h(g)}},b.prototype.bind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.bind());return e},b.prototype.unbind=function(){var a,b,c,d,e;d=this.bindings,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],e.push(a.unbind());return e},b}(),c=function(a,b,c){return window.addEventListener?a.addEventListener(b,c,!1):(b="on"+b,a.attachEvent(b,c))},h=function(a,b,c){return window.removeEventListener?a.removeEventListener(b,c,!1):(b="on"+b,a.detachEvent(b,c))},e=function(a){switch(a.type){case"checkbox":return a.checked;default:return a.value}},d=function(a){return function(b,d,e){d&&c(b,a,d);if(e)return h(b,a,e)}},f=function(a){return function(b,c,d){var e,f,h,i,j,k,l,m,n,o,p,q,r,s;if(d.iterated!=null){q=d.iterated;for(m=0,o=q.length;m<o;m++)i=q[m],i.view.unbind(),i.el.parentNode.removeChild(i.el)}else d.marker=document.createComment(" rivets: each-"+a+" "),b.parentNode.insertBefore(d.marker,b),b.parentNode.removeChild(b);d.iterated=[],s=[];for(n=0,p=c.length;n<p;n++){f=c[n],e={},r=d.view.models;for(k in r)j=r[k],e[k]=j;e[a]=f,h=b.cloneNode(!0),l=d.iterated[d.iterated.length-1]||d.marker,d.marker.parentNode.insertBefore(h,l.nextSibling),s.push(d.iterated.push({el:h,view:g.bind(h,e)}))}return s}},b=function(a){return function(b,c){return c?b.setAttribute(a,c):b.removeAttribute(a)}},a.routines={enabled:function(a,b){return a.disabled=!b},disabled:function(a,b){return a.disabled=!!b},checked:function(a,b){return a.type==="radio"?a.checked=a.value===b:a.checked=!!b},unchecked:function(a,b){return a.type==="radio"?a.checked=a.value!==b:a.checked=!b},show:function(a,b){return a.style.display=b?"":"none"},hide:function(a,b){return a.style.display=b?"none":""},html:function(a,b){return a.innerHTML=b!=null?b:""},value:function(a,b){return a.value=b!=null?b:""},text:function(a,b){return a.innerText!=null?a.innerText=b!=null?b:"":a.textContent=b!=null?b:""}},a.config={preloadData:!0},a.formatters={},g={routines:a.routines,formatters:a.formatters,config:a.config,configure:function(b){var c,d;b==null&&(b={});for(c in b)d=b[c],a.config[c]=d},bind:function(b,c){var d;return c==null&&(c={}),d=new a.View(b,c),d.bind(),d}},typeof module!="undefined"&&module!==null?module.exports=g:this.rivets=g}).call(this); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -165,10 +165,12 @@ class Rivets.View | ... | @@ -165,10 +165,12 @@ class Rivets.View |
165 | if iterator | 165 | if iterator |
166 | node.removeAttribute(a.name) for a in iterator | 166 | node.removeAttribute(a.name) for a in iterator |
167 | iterator = null | 167 | iterator = null |
168 | return | ||
168 | 169 | ||
169 | for el in @els | 170 | for el in @els |
170 | parseNode el | 171 | parseNode el |
171 | parseNode node for node in el.getElementsByTagName '*' | 172 | parseNode node for node in el.getElementsByTagName '*' |
173 | return | ||
172 | 174 | ||
173 | # Binds all of the current bindings for this view. | 175 | # Binds all of the current bindings for this view. |
174 | bind: => | 176 | bind: => |
... | @@ -218,7 +220,7 @@ iterationBinding = (name) -> (el, collection, binding) -> | ... | @@ -218,7 +220,7 @@ iterationBinding = (name) -> (el, collection, binding) -> |
218 | binding.marker = document.createComment " rivets: each-#{name} " | 220 | binding.marker = document.createComment " rivets: each-#{name} " |
219 | el.parentNode.insertBefore binding.marker, el | 221 | el.parentNode.insertBefore binding.marker, el |
220 | el.parentNode.removeChild el | 222 | el.parentNode.removeChild el |
221 | 223 | ||
222 | binding.iterated = [] | 224 | binding.iterated = [] |
223 | 225 | ||
224 | for item in collection | 226 | for item in collection |
... | @@ -291,6 +293,7 @@ rivets = | ... | @@ -291,6 +293,7 @@ rivets = |
291 | configure: (options={}) -> | 293 | configure: (options={}) -> |
292 | for property, value of options | 294 | for property, value of options |
293 | Rivets.config[property] = value | 295 | Rivets.config[property] = value |
296 | return | ||
294 | 297 | ||
295 | # Binds a set of model objects to a parent DOM element. Returns a Rivets.View | 298 | # Binds a set of model objects to a parent DOM element. Returns a Rivets.View |
296 | # instance. | 299 | # instance. | ... | ... |
-
Please register or sign in to post a comment