Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing callback naming issues with mootools

  • Loading branch information...
commit 977efe4e1d359757b14623fb5f64bdcd4d6206e6 1 parent 29b3a96
@markstory markstory authored
View
5 cake/libs/view/helpers/mootools_engine.php
@@ -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 . '});';
}
View
2  cake/tests/cases/libs/view/helpers/mootools_engine.test.php
@@ -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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.