Permalink
Browse files

Minor js review [ci skip]

Remove/add ; where necessary, fix indentation.
  • Loading branch information...
1 parent bd5f0ad commit c3e573db54c55c4e4ac694940c6d2f5b42b6155b @carlosantoniodasilva carlosantoniodasilva committed Dec 17, 2012
View
14 actionpack/lib/action_dispatch/middleware/templates/routes/_route_wrapper.html.erb
@@ -24,22 +24,22 @@
<script type='text/javascript'>
function each(elems, func) {
- if (!elems instanceof Array) var elems = [elems];
- for(var i = elems.length; i--; ) {
+ if (!elems instanceof Array) { elems = [elems]; }
+ for (var i = elems.length; i--; ) {
func(elems[i]);
- };
+ }
}
function setValOn(elems, val) {
each(elems, function(elem) {
elem.innerHTML = val;
- })
+ });
}
- function onClick(elems, func) {
+ function onClick(elems, func) {
each(elems, function(elem) {
elem.onclick = func;
- })
+ });
}
// Enables functionality to toggle between `_path` and `_url` helper suffixes
@@ -49,7 +49,7 @@
var helperTxt = this.getAttribute("data-route-helper");
var helperElems = document.querySelectorAll('[data-route-name] span.helper');
setValOn(helperElems, helperTxt);
- })
+ });
}
setupRouteToggleHelperLinks();

0 comments on commit c3e573d

Please sign in to comment.