User tests: Successful: Unsuccessful:
This prevents error if core.js is not loaded by defining the Joomla namespace
Solves #5258
Labels |
Added:
?
|
How about you just load core.js where the namespace is defined?
I think it's a bit strange when we start defining the same namespace in various places.
We should either load core.js or use a different/own/no namespace for the methods in the Isis template
The Joomla.toggleSidebar function has been removed in the latest sidebar PR.
@phproberto I am afraid it is still there! The problem is that right now is not in core.js but is also dependent on core.js, which is not optimal. Take a look here:
https://github.com/joomla/joomla-cms/blob/staging/administrator/templates/isis/js/template.js#L60
@phproberto The problem is that whenever a bootstrap modal is rendered an error:
ReferenceError: Can't find variable: Joomla
is getting logged
@phproberto it was just moved from core.js
to template.js
The question here is: do we really need to define the function as Joomla.tooggleSidebar ?
A function toggleSidebar I think is unique enough...
Imho, it's better without the Joomla namespace because it's template specific
Category | ⇒ | JavaScript |
@dgt41 yes i can, but it could be better in think to change Joomla.toggleSidebar into JtoggleSidebar, so that, no undefined namespace as @Bakual suggested :
use a different/own/no namespace for the methods in the Isis template
The Joomla.toggleSidebar function has been removed in the latest sidebar PR.
@phproberto i thought core.js was always loaded in backend... so i've not changed it. But we can!
@dgt41 better to open a new PR to fix namespace by changing Joomla.toggleSidebar in JtoggleSidebar ?
@JoomliC Hehe I already did this, take a look at https://github.com/joomla/joomla-cms/pull/5259/files
@JoomliC Yes, thats the weird thing core.js is called in layouts/joomla/sidebars/submenu.php
but for an unknown to me reason the modals throw an error. core.js will still be needed for the strings translations, so all that this is doing is removing the strange javascript error whenever a modal is fired!
@test works!
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/5259.
Title |
|
||||||
Status | Pending | ⇒ | Closed | ||||
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-12-14 15:07:03 |
To test go to Banners -> Tracks and press the button export
Apply the patch and retest!