Completed
Push — master ( fc7c74...94aea7 )
by Jean-Christophe
04:24
created
Ajax/Jquery.php 1 patch
Braces   +23 added lines, -15 removed lines patch added patch discarded remove patch
@@ -147,10 +147,12 @@  discard block
 block discarded – undo
147 147
 		if (isset($param)) {
148 148
 			$param=$this->_prep_value($param);
149 149
 			$str="$({$element}).{$jQueryCall}({$param});";
150
-		} else
151
-			$str="$({$element}).{$jQueryCall}();";
152
-			if ($immediatly)
153
-				$this->jquery_code_for_compile[]=$str;
150
+		} else {
151
+					$str="$({$element}).{$jQueryCall}();";
152
+		}
153
+			if ($immediatly) {
154
+							$this->jquery_code_for_compile[]=$str;
155
+			}
154 156
 			return $str;
155 157
 	}
156 158
 	/**
@@ -165,8 +167,9 @@  discard block
 block discarded – undo
165 167
 		$to=$this->_prep_element($to);
166 168
 		$element=$this->_prep_element($element);
167 169
 		$str="$({$to}).{$jQueryCall}({$element});";
168
-		if ($immediatly)
169
-			$this->jquery_code_for_compile[]=$str;
170
+		if ($immediatly) {
171
+					$this->jquery_code_for_compile[]=$str;
172
+		}
170 173
 			return $str;
171 174
 	}
172 175
 
@@ -222,12 +225,14 @@  discard block
 block discarded – undo
222 225
 		if ($stopPropagation===true) {
223 226
 			$js="event.stopPropagation();\n".$js;
224 227
 		}
225
-		if (array_search($event, $this->jquery_events)===false)
226
-			$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
227
-		else
228
-			$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
229
-		if($immediatly)
230
-			$this->jquery_code_for_compile[]=$event;
228
+		if (array_search($event, $this->jquery_events)===false) {
229
+					$event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n";
230
+		} else {
231
+					$event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n";
232
+		}
233
+		if($immediatly) {
234
+					$this->jquery_code_for_compile[]=$event;
235
+		}
231 236
 		return $event;
232 237
 	}
233 238
 
@@ -286,8 +291,9 @@  discard block
 block discarded – undo
286 291
 		}
287 292
 		$output=($script_tags===FALSE) ? $script : $this->inline($script);
288 293
 
289
-		if ($view!=NULL)
290
-			$this->jsUtils->createScriptVariable($view,$view_var, $output);
294
+		if ($view!=NULL) {
295
+					$this->jsUtils->createScriptVariable($view,$view_var, $output);
296
+		}
291 297
 		return $output;
292 298
 	}
293 299
 
@@ -354,7 +360,9 @@  discard block
 block discarded – undo
354 360
 	}
355 361
 
356 362
 	private function minify($input) {
357
-	if(trim($input) === "") return $input;
363
+	if(trim($input) === "") {
364
+		return $input;
365
+	}
358 366
 	return preg_replace(
359 367
 			array(
360 368
 					// Remove comment(s)
Please login to merge, or discard this patch.