? Pending

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
19 Jun 2017

Pull Request for Issue #16766 .

Summary of Changes

Fixes a console error in modal-associations.js,
Honestly I have no clue what I did here. Just followed @dgt41 instructions and it worked ?

Testing Instructions

Edit an article in the association component

Expected result

No console error

Actual result

Console error

Documentation Changes Required

None

avatar Bakual Bakual - open - 19 Jun 2017
avatar Bakual Bakual - change - 19 Jun 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Jun 2017
Category JavaScript
avatar wilsonge wilsonge - change - 19 Jun 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-06-19 12:10:12
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 19 Jun 2017
avatar wilsonge wilsonge - merge - 19 Jun 2017
avatar dgt41
dgt41 - comment - 19 Jun 2017

Honestly I have no clue what I did here.

It's not black magic, but let me explain:
we have a simple function were we pass 2 arguments (Joomla and window) both defined (the first on a line above the function declaration and the other one from the browser)

function( Joomla, window) { }

Now that function we want to be contained in an IIFE (Immediately-Invoked Function Expression) which has a very nice advantage as we don't end up with global variables. So a simple IIFE is like:

(function() {})();

But in our case we need to pass some arguments to the function so we do that like:

(function( Joomla, window) {})(Joomla, window);

I hope this is helpful

avatar Bakual
Bakual - comment - 19 Jun 2017

Ah, thanks. Makes sense ?

Add a Comment

Login with GitHub to post a comment