Passed
Push — master ( 42337f...468e47 )
by Jean-Christophe
02:24
created

Visibility::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ajax\semantic\components;
4
5
use Ajax\JsUtils;
6
7
/**
8
 * Visibility provides a set of callbacks for when a content appears in the viewport
9
 * @see https://semantic-ui.com/behaviors/visibility.html
10
 * @author jc
11
 *
12
 */
13
class Visibility extends SimpleSemExtComponent{
14
	
15
	public function __construct(JsUtils $js) {
16
		parent::__construct($js);
17
		$this->uiName="visibility";
18
		$this->params=["once"=>false,"observeChanges"=>true];
19
	}
20
	
21
	public function setOnce($value=false) {
22
		return $this->setParam("once", $value);
23
	}
24
	
25
	public function setObserveChanges($value=true) {
26
		return $this->setParam("observeChanges", $value);
27
	}
28
	
29
	public function setOnTopVisible($value) {
30
		$this->params["onTopVisible"]="%function(){".$value."}%";
31
	}
32
	
33
	public function setOnBottomVisible($value) {
34
		$this->params["onBottomVisible"]="%function(){".$value."}%";
35
	}
36
}
37