@@ -136,10 +136,12 @@ discard block |
||
| 136 | 136 | if (isset($param)) { |
| 137 | 137 | $param=Javascript::prep_value($param); |
| 138 | 138 | $str="$({$element}).{$jQueryCall}({$param});"; |
| 139 | - } else |
|
| 140 | - $str="$({$element}).{$jQueryCall}();"; |
|
| 141 | - if ($immediatly) |
|
| 142 | - $this->jquery_code_for_compile[]=$str; |
|
| 139 | + } else { |
|
| 140 | + $str="$({$element}).{$jQueryCall}();"; |
|
| 141 | + } |
|
| 142 | + if ($immediatly) { |
|
| 143 | + $this->jquery_code_for_compile[]=$str; |
|
| 144 | + } |
|
| 143 | 145 | return $str; |
| 144 | 146 | } |
| 145 | 147 | /** |
@@ -154,8 +156,9 @@ discard block |
||
| 154 | 156 | $to=Javascript::prep_element($to); |
| 155 | 157 | $element=Javascript::prep_element($element); |
| 156 | 158 | $str="$({$to}).{$jQueryCall}({$element});"; |
| 157 | - if ($immediatly) |
|
| 158 | - $this->jquery_code_for_compile[]=$str; |
|
| 159 | + if ($immediatly) { |
|
| 160 | + $this->jquery_code_for_compile[]=$str; |
|
| 161 | + } |
|
| 159 | 162 | return $str; |
| 160 | 163 | } |
| 161 | 164 | |
@@ -211,12 +214,14 @@ discard block |
||
| 211 | 214 | if ($stopPropagation===true) { |
| 212 | 215 | $js=Javascript::$stopPropagation.$js; |
| 213 | 216 | } |
| 214 | - if (array_search($event, $this->jquery_events)===false) |
|
| 215 | - $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 216 | - else |
|
| 217 | - $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 218 | - if($immediatly) |
|
| 219 | - $this->jquery_code_for_compile[]=$event; |
|
| 217 | + if (array_search($event, $this->jquery_events)===false) { |
|
| 218 | + $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 219 | + } else { |
|
| 220 | + $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 221 | + } |
|
| 222 | + if($immediatly) { |
|
| 223 | + $this->jquery_code_for_compile[]=$event; |
|
| 224 | + } |
|
| 220 | 225 | return $event; |
| 221 | 226 | } |
| 222 | 227 | |
@@ -301,7 +306,9 @@ discard block |
||
| 301 | 306 | } |
| 302 | 307 | |
| 303 | 308 | private function minify($input) { |
| 304 | - if(trim($input) === "") return $input; |
|
| 309 | + if(trim($input) === "") { |
|
| 310 | + return $input; |
|
| 311 | + } |
|
| 305 | 312 | return preg_replace( |
| 306 | 313 | array( |
| 307 | 314 | // Remove comment(s) |