Skip to content

Commit

Permalink
Removing unsupported options from PrototypeEngine. Fixes cakephp#1516
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Feb 8, 2011
1 parent 5841165 commit 9a94070
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cake/libs/view/helpers/prototype_engine.php
Expand Up @@ -45,10 +45,8 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
'error' => 'onFailure'
),
'sortable' => array(
'start' => 'onStart',
'sort' => 'onChange',
'complete' => 'onUpdate',
'distance' => 'snap',
),
'drag' => array(
'snapGrid' => 'snap',
Expand Down Expand Up @@ -262,6 +260,9 @@ function request($url, $options = array()) {
*
* #### Note: Requires scriptaculous to be loaded.
*
* The scriptaculous implementation of sortables does not suppot the 'start'
* and 'distance' options.
*
* @param array $options Array of options for the sortable.
* @return string Completed sortable script.
* @access public
Expand Down
4 changes: 1 addition & 3 deletions cake/tests/cases/libs/view/helpers/prototype_engine.test.php
Expand Up @@ -268,13 +268,11 @@ function testRequest() {
function testSortable() {
$this->Proto->get('#myList');
$result = $this->Proto->sortable(array(
'distance' => 5,
'start' => 'onStart',
'complete' => 'onComplete',
'sort' => 'onSort',
'wrapCallbacks' => false
));
$expected = 'var jsSortable = Sortable.create($("myList"), {onChange:onSort, onStart:onStart, onUpdate:onComplete, snap:5});';
$expected = 'var jsSortable = Sortable.create($("myList"), {onChange:onSort, onUpdate:onComplete});';
$this->assertEqual($result, $expected);
}

Expand Down

0 comments on commit 9a94070

Please sign in to comment.