User tests: Successful: Unsuccessful:
Added JavaScript events,
fixed behaviour of option 'parent' - previously it was overloaded by data attribute in method addSlide,
fixed usage of option 'active' - previously there was only one active slide for all accordions while each accordion can have own active slide,
start accordion only once based on selector which is an HTML ID and should be loaded only once even if params passed to method have changed.
Labels |
Added:
?
|
Here is a test code
<?php
echo JHtml::_('bootstrap.startAccordion', 'accordion1', array('parent' => true, 'active' => 'accordion1-slide1'
, 'onShow' => 'function(){console.log("onShow")}'
, 'onShown' => 'function(){console.log("onShown")}'
, 'onHide' => 'function(){console.log("onHide")}'
, 'onHidden' => 'function(){console.log("onHidden")}'
));
echo JHtml::_('bootstrap.addSlide', 'accordion1', 'Accordion 1 Slide 1', 'accordion1-slide1');
echo 'Slide 1 content. Activated on load';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.addSlide', 'accordion1', 'Accordion 1 Slide 2', 'accordion1-slide2');
echo 'Slide 2 content. Hides other slides when opening another one.';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.endAccordion');
echo JHtml::_('bootstrap.startAccordion', 'accordion2', array('parent' => false, 'active' => 'accordion2-slide2'));
echo JHtml::_('bootstrap.addSlide', 'accordion2', 'Accordion 2 Slide 1', 'accordion2-slide1');
echo 'Slide 1 content. Does not hide other slides when opening another one.';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.addSlide', 'accordion2', 'Accordion 2 Slide 2', 'accordion2-slide2');
echo 'Slide 2 content. Activated on load';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.endAccordion');
echo JHtml::_('bootstrap.startAccordion', 'accordion3');
echo JHtml::_('bootstrap.addSlide', 'accordion3', 'Accordion 3 Slide 1', 'accordion3-slide1');
echo 'Slide 1 content. Does not open on load. Does not hide other slides when opening another one.';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.addSlide', 'accordion3', 'Accordion 3 Slide 2', 'accordion3-slide2');
echo 'Slide 2 content. Does not open on load. Does not hide other slides when opening another one.';
echo JHtml::_('bootstrap.endSlide');
echo JHtml::_('bootstrap.endAccordion');
@test I tested this patch by copy-past the test code in the article view on front-end. Looks good for me, thanks!
Please correct this to, and Travis should be happy :-)
FILE: /home/travis/build/joomla/joomla-cms/libraries/cms/html/bootstrap.php
--------------------------------------------------------------------------------
FOUND 0 ERROR(S) AND 3 WARNING(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
586 | WARNING | Line exceeds 150 characters; contains 176 characters
588 | WARNING | Line exceeds 150 characters; contains 172 characters
677 | WARNING | Line exceeds 150 characters; contains 182 characters
--------------------------------------------------------------------------------
Thanks for chancing! One more test needed over here
Category | ⇒ | JavaScript |
@test ok -ish
Where before the patch, all opened tabs in each accordion would be closed regardless of the options set, each but the last accordion will react as described after the patch, including firing those events.
That said, I might have missed something or the description in each accordion 3 tab doesn't match the actual bebahvior. I would have expected this (Accordion 3):
Slide 1 content. Does not open on load. Does not hide other slides when opening another one.
Slide 2 content. Does not open on load. Does not hide other slides when opening another one.
If that is the intended behavior, and the description just cosmetics - it's all good.
Status | Pending | ⇒ | Ready to Commit |
Thanks for testing and coding! Moving this now to RTC!
@matrikular you are right. I have made an error in 3-rd accordion description. It should be: Does not open on load. Does not hide other slides when opening another one. Probably I have copied old description, but tested behaviour is correct.
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-04-14 21:21:12 |
Labels |
Removed:
?
|
Can you please add some test instructions so we can test this patch?