Skip to content
Permalink
Browse files

Fixing callback naming issues with mootools

  • Loading branch information...
markstory committed Mar 28, 2009
1 parent 29b3a96 commit 977efe4e1d359757b14623fb5f64bdcd4d6206e6
@@ -44,6 +44,9 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
'sortable' => array(
'distance' => 'snap',
'containment' => 'constrain',
'sort' => 'onSort',
'complete' => 'onComplete',
'start' => 'onStart',
)
);
/**
@@ -198,7 +201,7 @@ function request($url, $options = array()) {
**/
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 . '});';
}
@@ -184,7 +184,7 @@ function testSortable() {
'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);
}
}

0 comments on commit 977efe4

Please sign in to comment.
You can’t perform that action at this time.