User tests: Successful: Unsuccessful:
Pull Request for Issue # .
For modals, tooltips, popover and tabs apply this patch and navigate to isis template on the backend. Ensure that no javascript errors are logged and everything still works.
To test the other bootstrap components download this module https://github.com/dgt41/bootstrap-test/raw/gh-pages/bootstrap_test.zip install, publish in the front end and then visit that page (template must be protostar).
Enjoy!
There are few layouts that are touched, but joomla's b/c promise states that these are not B/C breaks. Down to PLT for a decision on that.
None.
Calling @andrepereiradasilva @Fedik to review
@laoneo this might help your quest for bootstrap 3
Category | ⇒ | Layout Libraries JavaScript |
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | Layout Libraries JavaScript | ⇒ | Layout Libraries JavaScript Unit Tests |
Labels |
Added:
?
|
@dgt41 - I would suggest defining $(this)
as a variable (var $self = $(this)
) if it's used multiple times in the same function
Before:
var tooltipsSelector = $(this).data('selector'),
animation = $(this).data('animation'),
html = $(this).data('html'),
placement = $(this).data('placement'),
title = $(this).data('title'),
selector2 = $(this).data('other-selector'),
trigger = $(this).data('trigger'),
delay = $(this).data('delay'),
container = $(this).data('container'),
template = $(this).data('template'),
$onshow = $(this).data('on-show'),
$onshown = $(this).data('on-shown'),
$onhide = $(this).data('on-hide'),
$onhidden = $(this).data('on-hidden');
After:
var $self = $(this),
tooltipsSelector = $self.data('selector'),
animation = $self.data('animation'),
html = $self.data('html'),
placement = $self.data('placement'),
title = $self.data('title'),
selector2 = $self.data('other-selector'),
trigger = $self.data('trigger'),
delay = $self.data('delay'),
container = $self.data('container'),
template = $self.data('template'),
$onshow = $self.data('on-show'),
$onshown = $self.data('on-shown'),
$onhide = $self.data('on-hide'),
$onhidden = $self.data('on-hidden');
Sorry to be nit-picky, but a performance decrease springs to mind when I see creating the same jQuery object loads of times
@dgt41 - You've made some mistakes with $self
. There will be some instances where you need to redefine it as it's out of scope:
var $self = $(this);
$('.modalTooltip').each(function(){
var attr = $self.attr('data-placement');
});
As you can see from the above code, attr
will not represent the data-placement
attribute value for $('.modalTooltip')
because you've defined $self
outside each(function() { ...
If you want me to re-do it for you and put it on PasteBin, let me know and I'll send it over
This is exactly why JHtml has a registered callback system.
If you're hell bound and determined to move everything to layouts then JHtml::register()
, JHtml::unregister()
, JHtml::isRegistered()
, JHtml::_()
, JHtml::call()
, and JHtml::extract()
should be deprecated and everything refactored to just call the methods directly.
Until that happens, I honestly just see this PR as adding more complexity to an already complex and poorly constructed system in general. We've already merged a ton of crap code and even crappier layout structures, can we stop doing this? There is no freakin' reason at all to have a layout that has nothing but a closing div or nothing but pure PHP function calls.
@dgt41 you know I am against such stuff, against use an empty element to keep the options
it have no profit, really
it force +1 DOM search for each feature, and work with DOM always slower.
Here is huge drawback if compare to inline script: All code bootstrap-init.js
will be always executed. Example DOM query $('.joomla-accordion')
will be always run, even if accordion
not exist on the page, and there more such queries in the file.
And data-blabla=""
should be assigned to the element where it used (instead of empty random element), otherwise use scriptOptions.
@Fedik Flexibility comes at a cost. This PR allows overriding of some hidden in the bootstrap.php code. Could it be done otherwise? Yes! In my code I override the bootstrap.php altogether. Maybe this could be broken to individual scripts per component as @yvesh suggested! Then we don't have useless empty elements. About the span/data: in some cases is really hard to not go this way. The idea here was to give some flexibility to template creators to move from 2.3.2 to 3 with minimum effort...
This PR allows overriding of some hidden in the bootstrap.php code
yes I understood it, but the cost is to height, for my opinion
There should be a better way, I try to show you some example, in near future, I hope
I tried similar in #6357, there "bootstrap feature" runs only if it requested
@dgt41 check #11671,
can take #6357 without Joomla.Behavior
part,
mean only behavior-xxxx.js
files and changes in /html/
and do something like:
var accordion = Joomla.getOptions('bootstrap.accordion');
if(accordion){
// Set up Bootstrap Accordion feature
}
In result we do not have useless DOM query, and do not have inline JavaScript
@Fedik @andrepereiradasilva please check
Category | Layout Libraries JavaScript Unit Tests | ⇒ | JavaScript Layout Libraries |
Category | Layout Libraries JavaScript | ⇒ | Layout Libraries JavaScript Unit Tests |
Labels |
Removed:
?
|
Labels |
Added:
?
|
If I add options to the carousel, like this JHtml::_('bootstrap.carousel', 'myCarousel', array("interval" => 500));
nothing change...
Before I changed the interval to 500 the slider slides approximately every 5 second. After I change the interval to 500 this is still the same.
I did not specified with a # or something like that. The case I described was based on you example module.
Oops something went horribly wrong here
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-04 15:01:31 |
Closed_By | ⇒ | dgt41 |
@dgt41 looks like you also need to update the php unit tests accordingly.. Travis is complaining