Fixing callback naming issues with mootools

This commit is contained in:
mark_story 2009-03-28 00:31:51 -04:00
parent 29b3a96cb2
commit 977efe4e1d
2 changed files with 5 additions and 2 deletions

View file

@ -44,6 +44,9 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
'sortable' => array(
'distance' => 'snap',
'containment' => 'constrain',
'sort' => 'onSort',
'complete' => 'onComplete',
'start' => 'onStart',
)
);
/**
@ -198,7 +201,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
**/
function sortable($options = array()) {
$options = $this->_mapOptions('sortable', $options);
$callbacks = array('start', 'sort', 'complete');
$callbacks = array('onStart', 'onSort', 'onComplete');
$options = $this->_parseOptions($options, $callbacks);
return 'var mooSortable = new Sortables(' . $this->selection . ', {' . $options . '});';
}

View file

@ -184,7 +184,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
'complete' => 'onStop',
'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);
}
}