Completed
Push — master ( a4369d...ea5934 )
by Jean-Christophe
02:50
created

Modal::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Ajax\semantic\components;
4
5
use Ajax\JsUtils;
6
7
class Modal extends SimpleSemExtComponent {
8
9
	public function __construct(JsUtils $js) {
10
		parent::__construct($js);
11
		$this->uiName="modal";
12
	}
13
14
	protected function setBehavior($name) {
15
		$this->paramParts[]=[$name];
16
		return $this;
17
	}
18
19
	public function showDimmer(){
20
		return $this->setBehavior("hide dimmer");
21
	}
22
23
	public function setInverted(){
24
		$this->params["inverted"]=true;
25
	}
26
27
	public function setOnHidden($jsCode) {
28
		$jsCode=str_ireplace("\"","%quote%", $jsCode);
29
		return $this->setParam("onHidden", "%function(){".$jsCode."}%");
30
	}
31
}
32