This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove inline Javascript for administrator/components/com_languages/t…
…mpl/override/edit.php (#89) * Remove inline Javascript for administrator/components/com_languages/tmpl/override/edit.php * use slice in foreach * deleted line * wip * use data attrib as it is a state specific behavior * worked on the forgotton inline javascript * worked on the forgotton inline javascript * correction * correction * rename data attribute
- Loading branch information
1 parent
bbcc06b
commit 7f2cbcf
Showing
3 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
media/com_languages/js/admin-override-edit-refresh-searchstring.es6.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
document.getElementById('jform_searchstring').addEventListener('focus', (event) => { | ||
if (!Joomla.overrider.states.refreshed) { | ||
const expired = document.getElementById('overrider-spinner').getAttribute('data-search-string-expired'); | ||
if (expired) { | ||
Joomla.overrider.refreshCache(); | ||
Joomla.overrider.states.refreshed = true; | ||
} | ||
} | ||
event.currentTarget.classList.remove('invalid'); | ||
}, false); | ||
|
||
document.getElementById('more-results-button').addEventListener('click', () => { | ||
Joomla.overrider.searchStrings(Joomla.overrider.states.more); | ||
}, false); | ||
}); | ||
|
26 changes: 26 additions & 0 deletions
26
media/com_languages/js/admin-override-edit-refresh-searchstring.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* 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 | ||
*/ | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
document.getElementById('jform_searchstring').addEventListener('focus', function (event) { | ||
if (!Joomla.overrider.states.refreshed) { | ||
var expired = document.getElementById('overrider-spinner').getAttribute('data-search-string-expired'); | ||
if (expired) { | ||
Joomla.overrider.refreshCache(); | ||
Joomla.overrider.states.refreshed = true; | ||
} | ||
} | ||
event.currentTarget.classList.remove('invalid'); | ||
}, false); | ||
|
||
document.getElementById('more-results-button').addEventListener('click', function () { | ||
Joomla.overrider.searchStrings(Joomla.overrider.states.more); | ||
}, false); | ||
}); |