Skip to content

Commit

Permalink
Fixing callback naming issues with mootools
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 28, 2009
1 parent 29b3a96 commit 977efe4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cake/libs/view/helpers/mootools_engine.php
Expand Up @@ -44,6 +44,9 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
'sortable' => array( 'sortable' => array(
'distance' => 'snap', 'distance' => 'snap',
'containment' => 'constrain', 'containment' => 'constrain',
'sort' => 'onSort',
'complete' => 'onComplete',
'start' => 'onStart',
) )
); );
/** /**
Expand Down Expand Up @@ -198,7 +201,7 @@ function request($url, $options = array()) {
**/ **/
function sortable($options = array()) { function sortable($options = array()) {
$options = $this->_mapOptions('sortable', $options); $options = $this->_mapOptions('sortable', $options);
$callbacks = array('start', 'sort', 'complete'); $callbacks = array('onStart', 'onSort', 'onComplete');
$options = $this->_parseOptions($options, $callbacks); $options = $this->_parseOptions($options, $callbacks);
return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});'; return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});';
} }
Expand Down
Expand Up @@ -184,7 +184,7 @@ function testSortable() {
'complete' => 'onStop', 'complete' => 'onStop',
'sort' => 'onSort', 'sort' => 'onSort',
)); ));
$expected = 'var mooSortable = new Sortables($("myList"), {start:onStart, complete:onStop, sort:onSort, snap:5, constrain:"parent"});'; $expected = 'var mooSortable = new Sortables($("myList"), {constrain:"parent", onComplete:onStop, onSort:onSort, onStart:onStart, snap:5});';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
} }
} }
Expand Down

0 comments on commit 977efe4

Please sign in to comment.