Skip to content

Commit 16888fe

Browse files
committed
Fix js attachment
1 parent 15d4169 commit 16888fe

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Ajax/semantic/components/SimpleSemExtComponent.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,10 @@ public function addComponentEvent($event,$jsCode){
4646
$jsCode=\str_ireplace("\"","%quote%", $jsCode);
4747
return $this->setParam($event, "%function(){".$jsCode."}%");
4848
}
49+
50+
public function setJs(JsUtils $js){
51+
$this->js=$js;
52+
$js->semantic()->addComponent($this, $this->attachTo, $this->params);
53+
}
4954

5055
}

Ajax/semantic/html/base/HtmlSemDoubleElement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function run(JsUtils $js) {
169169
$this->_popup->run($js);
170170
}
171171
if (isset($this->_toast)) {
172-
$this->_toast->run($js);
172+
$this->_toast->setJs($js);
173173
}
174174
return $this->_bsComponent;
175175
}
@@ -193,6 +193,7 @@ public function addList($items,$ordered=false){
193193
*/
194194
public function asToast($params=NULL){
195195
$this->_toast=new Toast();
196+
$this->_toast->attach('#'.$this->_identifier);
196197
if(isset($params)){
197198
$this->_toast->setParams($params);
198199
}

0 commit comments

Comments
 (0)