mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Fixing callback naming issues with mootools
This commit is contained in:
parent
29b3a96cb2
commit
977efe4e1d
2 changed files with 5 additions and 2 deletions
|
@ -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',
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
/**
|
/**
|
||||||
|
@ -198,7 +201,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
|
||||||
**/
|
**/
|
||||||
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 . '});';
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,7 +184,7 @@ class MooEngineHelperTestCase extends CakeTestCase {
|
||||||
'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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue