Skip to content
This repository
Browse code

declare with 'var' for local variables

  • Loading branch information...
commit 3ae87dae14ef7358e0cebf2100f1c71f362f6372 1 parent 605cd50
authored November 12, 2008

Showing 1 changed file with 4 additions and 4 deletions. Show diff stats Hide diff stats

  1. 8  javascripts/sources/jrails.js
8  javascripts/sources/jrails.js
@@ -69,14 +69,14 @@
69 69
 			if (typeof window.delayedObserverStack == 'undefined') window.delayedObserverStack = [];
70 70
 			if (typeof window.delayedObserverCallback == 'undefined') {
71 71
 				window.delayedObserverCallback = function(stackPos) {
72  
-					observed = window.delayedObserverStack[stackPos];
  72
+					var observed = window.delayedObserverStack[stackPos];
73 73
 					if (observed.timer) clearTimeout(observed.timer);
74 74
 					observed.timer = setTimeout(function(){
75 75
 						observed.timer = null;
76 76
 						observed.callback(observed.obj, observed.obj.formVal());
77 77
 					}, observed.delay * 1000);
78 78
 					observed.oldVal = observed.obj.formVal();
79  
-				}
  79
+				};
80 80
 			}
81 81
 			window.delayedObserverStack.push({
82 82
 				obj: el, timer: null, delay: delay,
@@ -87,14 +87,14 @@
87 87
 				$(':input', el).each(function(){
88 88
 					var field = $(this);
89 89
 					field.bind($.fieldEvent(field, delay), function(){
90  
-						observed = window.delayedObserverStack[stackPos];
  90
+						var observed = window.delayedObserverStack[stackPos];
91 91
 						if (observed.obj.formVal() == observed.oldVal) return;
92 92
 						else window.delayedObserverCallback(stackPos);
93 93
 					});
94 94
 				});
95 95
 			} else {
96 96
 				el.bind($.fieldEvent(el, delay), function(){
97  
-					observed = window.delayedObserverStack[stackPos];
  97
+					var observed = window.delayedObserverStack[stackPos];
98 98
 					if (observed.obj.formVal() == observed.oldVal) return;
99 99
 					else window.delayedObserverCallback(stackPos);
100 100
 				});

0 notes on commit 3ae87da

Please sign in to comment.
Something went wrong with that request. Please try again.