Skip to content

Commit db4c081

Browse files
committed
ajax method +modal bug fixed
1 parent fb7dfb3 commit db4c081

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Ajax/common/traits/JsUtilsAjaxTrait.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,22 @@ public function get($url, $responseElement="", $params="{}", $jsCallback=NULL,$h
140140
return $this->_get($url,$params,$responseElement,$jsCallback,null,$hasLoader,$jqueryDone,$ajaxTransition,true);
141141
}
142142

143+
/**
144+
* Performs an ajax request
145+
* @param string $method The http method (get, post, delete, put, head)
146+
* @param string $url The url of the request
147+
* @param string $params JSON parameters
148+
* @param string $responseElement selector of the HTML element displaying the answer
149+
* @param string $jsCallback javascript code to execute after the request
150+
* @param boolean $hasLoader true for showing ajax loader. default : true
151+
* @param string $jqueryDone the jquery function call on ajax data. default:html
152+
* @param string|callable $ajaxTransition
153+
*/
154+
public function ajax($method,$url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true,$jqueryDone="html",$ajaxTransition=null) {
155+
$method=\strtolower($method);
156+
return $this->_ajax($method,$url,$params,$responseElement,$jsCallback,null,$hasLoader,$jqueryDone,$ajaxTransition,true);
157+
}
158+
143159
/**
144160
* Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name
145161
* @param string $url the request url

Ajax/semantic/html/modules/HtmlModal.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public function setActions($actions) {
5050
return $this;
5151
}
5252

53+
/**
54+
* @param string|BaseHtml $action
55+
* @return HtmlButton
56+
*/
5357
public function addAction($action){
5458
if(!$action instanceof BaseHtml){
5559
$class="";
@@ -59,7 +63,7 @@ public function addAction($action){
5963
if(\array_search($action, ["Close","Cancel","No"])!==false){
6064
$class="cancel";
6165
}
62-
$action=new HtmlButton("action-".$this->identifier,$action);
66+
$action=new HtmlButton("action-".$this->identifier."-".\sizeof($this->content["actions"]->getContent()),$action);
6367
if($class!=="")
6468
$action->addToProperty("class", $class);
6569
}

0 commit comments

Comments
 (0)