Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
9a98aa95
Commit
9a98aa95
authored
May 26, 2013
by
Alexander Kochetov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Sortable::begin() ... Sortable::end() usage.
parent
c6076cb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
36 deletions
+12
-36
Sortable.php
framework/yii/jui/Sortable.php
+12
-36
No files found.
framework/yii/jui/Sortable.php
View file @
9a98aa95
...
@@ -20,36 +20,23 @@ use yii\helpers\Html;
...
@@ -20,36 +20,23 @@ use yii\helpers\Html;
* echo Sortable::widget(array(
* echo Sortable::widget(array(
* 'items' => array(
* 'items' => array(
* 'Item 1',
* 'Item 1',
* 'Item 2',
* array(
* 'Item 3',
* 'content' => 'Item2',
* 'options' => array(
* 'tag' => 'li',
* ),
* ),
* ),
* ),
* 'clientOptions' => array(
* 'cursor' => 'move',
* ),
* ));
* ```
*
* The following example will show the content enclosed between the [[begin()]]
* and [[end()]] calls within the sortable widget:
*
* ```php
* Sortable::begin(array(
* 'options' => array(
* 'options' => array(
* 'tag' => '
div
',
* 'tag' => '
ul
',
* ),
* ),
* 'itemOptions' => array(
* 'itemOptions' => array(
* 'tag' => '
div
',
* 'tag' => '
li
',
* ),
* ),
* 'clientOptions' => array(
* 'clientOptions' => array(
* 'cursor' => 'move',
* 'cursor' => 'move',
* ),
* ),
* ));
* ));
*
* echo 'Item 1';
* echo 'Item 2';
* echo 'Item 3';
*
* Sortable::end();
* ```
* ```
*
*
* @see http://api.jqueryui.com/sortable/
* @see http://api.jqueryui.com/sortable/
...
@@ -59,35 +46,24 @@ use yii\helpers\Html;
...
@@ -59,35 +46,24 @@ use yii\helpers\Html;
class
Sortable
extends
Widget
class
Sortable
extends
Widget
{
{
/**
/**
* @var array.
* @var array list of sortable containers.
* @todo comments
*/
*/
public
$items
=
array
();
public
$items
=
array
();
/**
/**
* @var array.
* @var array list of individual sortable container default options.
* @todo comments
*/
*/
public
$itemOptions
=
array
();
public
$itemOptions
=
array
();
/**
/**
*
Initialize
s the widget.
*
Render
s the widget.
*/
*/
public
function
init
()
public
function
run
()
{
{
parent
::
init
();
$options
=
$this
->
options
;
$options
=
$this
->
options
;
$tag
=
ArrayHelper
::
remove
(
$options
,
'tag'
,
'ul'
);
$tag
=
ArrayHelper
::
remove
(
$options
,
'tag'
,
'ul'
);
echo
Html
::
beginTag
(
$tag
,
$options
)
.
"
\n
"
;
echo
Html
::
beginTag
(
$tag
,
$options
)
.
"
\n
"
;
}
/**
* Renders the widget.
*/
public
function
run
()
{
echo
$this
->
renderItems
()
.
"
\n
"
;
echo
$this
->
renderItems
()
.
"
\n
"
;
$tag
=
ArrayHelper
::
getValue
(
$this
->
options
,
'tag'
,
'ul'
);
echo
Html
::
endTag
(
$tag
)
.
"
\n
"
;
echo
Html
::
endTag
(
$tag
)
.
"
\n
"
;
$this
->
registerWidget
(
'sortable'
,
false
);
$this
->
registerWidget
(
'sortable'
,
false
);
}
}
...
...
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