Skip to content

Commit 23beed0

Browse files
committed
stopprop and prevent on click
1 parent c286d30 commit 23beed0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Ajax/common/traits/JsUtilsEventsTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ public function change($element='this', $js='') {
4545
* @param string $element element to attach the event to
4646
* @param string|array $js code to execute
4747
* @param boolean $ret_false or not to return false
48+
* @param boolean $preventDefault
49+
* @param boolean $stopPropagation
4850
* @return string
4951
*/
50-
public function click($element='this', $js='', $ret_false=TRUE) {
52+
public function click($element='this', $js='', $ret_false=TRUE,$preventDefault=false,$stopPropagation=false) {
5153
if (!is_array($js)) {
5254
$js=array (
5355
$js
@@ -58,7 +60,7 @@ public function click($element='this', $js='', $ret_false=TRUE) {
5860
$js[]="return false;";
5961
}
6062

61-
return $this->_add_event($element, $js, 'click');
63+
return $this->_add_event($element, $js, 'click',$preventDefault,$stopPropagation);
6264
}
6365

6466
/**

0 commit comments

Comments
 (0)