Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
Yii Bootstrap 3
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Common
Yii Bootstrap 3
Commits
d7868435
Commit
d7868435
authored
Apr 25, 2012
by
niskac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for setting JS options for BootModal
parent
2aba5d86
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
BootModal.php
widgets/BootModal.php
+10
-0
No files found.
widgets/BootModal.php
View file @
d7868435
...
...
@@ -16,6 +16,10 @@ Yii::import('bootstrap.widgets.BootWidget');
class
BootModal
extends
CWidget
{
/**
* @var boolean whether to automatically open the modal when initialized.
*/
public
$autoOpen
=
false
;
/**
* @var array the options for the Bootstrap JavaScript plugin.
*/
public
$options
=
array
();
...
...
@@ -35,6 +39,9 @@ class BootModal extends CWidget
{
parent
::
init
();
if
(
!
$this
->
autoOpen
&&
!
isset
(
$this
->
options
[
'show'
]))
$this
->
options
[
'show'
]
=
false
;
if
(
!
isset
(
$this
->
htmlOptions
[
'id'
]))
$this
->
htmlOptions
[
'id'
]
=
$this
->
getId
();
...
...
@@ -59,6 +66,9 @@ class BootModal extends CWidget
/** @var CClientScript $cs */
$cs
=
Yii
::
app
()
->
getClientScript
();
$options
=
CJavaScript
::
encode
(
$this
->
options
);
$cs
->
registerScript
(
__CLASS__
.
'#'
.
$id
,
"jQuery('#
{
$id
}
').modal(
{
$options
}
);"
);
// Register the "show" event-handler.
if
(
isset
(
$this
->
events
[
'show'
]))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment