phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
Collapse.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\bootstrap\components
;
4
5
use
Ajax\JsUtils
;
6
use
Ajax\common\JsCode
;
7
use
Ajax\common\components\SimpleExtComponent
;
8
14
class
Collapse
extends
SimpleExtComponent
{
15
protected
$collapsed
;
16
17
public
function
__construct
(
JsUtils
$js
) {
18
parent::__construct(
$js
);
19
$this->uiName=
"collapse"
;
20
}
21
22
public
function
attach
($identifier) {
23
parent::attach($identifier);
24
$this->js->attr($identifier,
"data-toggle"
,
"collapse"
,
true
);
25
}
26
27
public
function
show
() {
28
$this->jsCodes []=
new
JsCode
(
' $(function () {$("%identifier%").click();});'
);
29
}
30
36
public
function
onShow
($jsCode) {
37
return
$this->
addEvent
(
"show.bs.collapse"
, $jsCode);
38
}
39
45
public
function
onShown
($jsCode) {
46
return
$this->
addEvent
(
"shown.bs.collapse"
, $jsCode);
47
}
48
54
public
function
onHide
($jsCode) {
55
return
$this->
addEvent
(
"hide.bs.collapse"
, $jsCode);
56
}
57
63
public
function
onHidden
($jsCode) {
64
return
$this->
addEvent
(
"hidden.bs.collapse"
, $jsCode);
65
}
66
67
protected
function
compileEvents
() {
68
foreach
( $this->events as $event => $jsCode ) {
69
$this->jquery_code_for_compile []=
"$( \""
.$this->collapsed.
"\" ).on(\""
.$event.
"\" , function (e) {"
.$jsCode.
"});"
;
70
}
71
}
72
73
public
function
setCollapsed
(
$collapsed
) {
74
$this->collapsed=
$collapsed
;
75
return
$this;
76
}
77
}
Ajax\JsUtils
JQuery PHP library.
Definition
JsUtils.php:23
Ajax\bootstrap\components\Collapse
Composant Twitter Bootstrap Collapse.
Definition
Collapse.php:14
Ajax\bootstrap\components\Collapse\$collapsed
$collapsed
Definition
Collapse.php:15
Ajax\bootstrap\components\Collapse\attach
attach($identifier)
Definition
Collapse.php:22
Ajax\bootstrap\components\Collapse\show
show()
Definition
Collapse.php:27
Ajax\bootstrap\components\Collapse\setCollapsed
setCollapsed($collapsed)
Definition
Collapse.php:73
Ajax\bootstrap\components\Collapse\onShow
onShow($jsCode)
This event fires immediately when the show instance method is called.
Definition
Collapse.php:36
Ajax\bootstrap\components\Collapse\onHide
onHide($jsCode)
This event is fired immediately when the hide method has been called.
Definition
Collapse.php:54
Ajax\bootstrap\components\Collapse\onHidden
onHidden($jsCode)
This event is fired when a collapse element has been hidden from the user (will wait for CSS transiti...
Definition
Collapse.php:63
Ajax\bootstrap\components\Collapse\onShown
onShown($jsCode)
This event is fired when a collapse element has been made visible to the user (will wait for CSS tran...
Definition
Collapse.php:45
Ajax\bootstrap\components\Collapse\compileEvents
compileEvents()
Definition
Collapse.php:67
Ajax\bootstrap\components\Collapse\__construct
__construct(JsUtils $js)
Definition
Collapse.php:17
Ajax\common\JsCode
Base class for js code.
Definition
JsCode.php:10
Ajax\common\components\BaseComponent\$js
$js
Definition
BaseComponent.php:20
Ajax\common\components\SimpleExtComponent
Definition
SimpleExtComponent.php:7
Ajax\common\components\SimpleExtComponent\addEvent
addEvent($event, $jsCode)
Definition
SimpleExtComponent.php:11
Ajax\bootstrap\components
Definition
Carousel.php:3
Ajax
bootstrap
components
Collapse.php
Generated on Sun Dec 10 2023 16:15:50 for
phpMv-UI
by
doxygen
1.9.8