Skip to content

Commit

Permalink
Merge pull request #33 from joomla-projects/mod_multilangstatus
Browse files Browse the repository at this point in the history
transform admin-multilangstatus.js to es6
  • Loading branch information
Dimitri Grammatikogianni authored Feb 21, 2018
2 parents 8d194a9 + 0b5fa84 commit bd0e31c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
24 changes: 24 additions & 0 deletions media/mod_multilangstatus/js/admin-multilangstatus.es6.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

(() => {
'use strict';

document.addEventListener('DOMContentLoaded', () => {
// We need to use JS to move the modal before the closing body tag to avoid stacking issues
const multilangueModal = document.getElementById('multiLangModal');

if (multilangueModal) {
// Clone the modal element
const clone = multilangueModal.cloneNode(true);

// Remove the original modal element
multilangueModal.parentNode.removeChild(multilangueModal);

// Append clone before closing body tag
document.body.appendChild(clone);
}
});
})();
38 changes: 20 additions & 18 deletions media/mod_multilangstatus/js/admin-multilangstatus.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

(function() {
'use strict';

document.addEventListener('DOMContentLoaded', function() {

// We need to use JS to move the modal before the closing body tag to avoid stacking issues
var multilangueModal = document.getElementById('multiLangModal');

if (multilangueModal) {
// Clone the modal element
var clone = multilangueModal.cloneNode(true);
(function () {
'use strict';

// Remove the original modal element
multilangueModal.parentNode.removeChild(multilangueModal);
document.addEventListener('DOMContentLoaded', function () {
// We need to use JS to move the modal before the closing body tag to avoid stacking issues
var multilangueModal = document.getElementById('multiLangModal');

// Append clone before closing body tag
document.body.appendChild(clone);
}
if (multilangueModal) {
// Clone the modal element
var clone = multilangueModal.cloneNode(true);

});
// Remove the original modal element
multilangueModal.parentNode.removeChild(multilangueModal);

})();
// Append clone before closing body tag
document.body.appendChild(clone);
}
});
})();

0 comments on commit bd0e31c

Please sign in to comment.