Applying patch from 'hashmich' to fix issues with slideUp and slideDown effects in prototype engine.

Tests updated.
Fixes #1213
This commit is contained in:
mark_story 2010-10-20 22:07:53 -04:00
parent ffc77aa588
commit 077d1c5ad5
2 changed files with 5 additions and 5 deletions

View file

@ -211,7 +211,7 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
break;
case 'slideIn':
case 'slideOut':
$name = ($name == 'slideIn') ? 'slideDown' : 'slideUp';
$name = ($name == 'slideIn') ? 'SlideDown' : 'SlideUp';
$effect = 'Effect.' . $name . '(' . $this->selection . $optionString . ');';
break;
case 'fadeIn':

View file

@ -153,19 +153,19 @@ class PrototypeEngineHelperTestCase extends CakeTestCase {
$this->assertEqual($result, $expected);
$result = $this->Proto->effect('slideIn');
$expected = 'Effect.slideDown($("foo"));';
$expected = 'Effect.SlideDown($("foo"));';
$this->assertEqual($result, $expected);
$result = $this->Proto->effect('slideOut');
$expected = 'Effect.slideUp($("foo"));';
$expected = 'Effect.SlideUp($("foo"));';
$this->assertEqual($result, $expected);
$result = $this->Proto->effect('slideOut', array('speed' => 'fast'));
$expected = 'Effect.slideUp($("foo"), {duration:0.50000000000});';
$expected = 'Effect.SlideUp($("foo"), {duration:0.50000000000});';
$this->assertEqual($result, $expected);
$result = $this->Proto->effect('slideOut', array('speed' => 'slow'));
$expected = 'Effect.slideUp($("foo"), {duration:2});';
$expected = 'Effect.SlideUp($("foo"), {duration:2});';
$this->assertEqual($result, $expected);
}