mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-11 09:36:24 +01:00
[CHANGE] JS updated to ES8+ standard where ever possible
This commit is contained in:
@@ -163,7 +163,8 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
|
||||
|
||||
<script>
|
||||
const clipboard = new ClipboardJS('.copy-text-fa-icon');
|
||||
clipboard.on('success', function (e) {
|
||||
|
||||
clipboard.on('success', (e) => {
|
||||
console.info('Action:', e.action);
|
||||
console.info('Text:', e.text);
|
||||
console.info('Trigger:', e.trigger);
|
||||
@@ -171,12 +172,12 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
clipboard.on('error', (e) => {
|
||||
console.error('Action:', e.action);
|
||||
console.error('Trigger:', e.trigger);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$(document).ready(() => {
|
||||
const elementEditableSrpAmount = $('.srp');
|
||||
const elementTableSrpList = $('table.srplist');
|
||||
|
||||
@@ -202,12 +203,12 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
|
||||
$.fn.dataTable.moment('YYYY-MMM-D, HH:mm');
|
||||
|
||||
elementEditableSrpAmount.editable({
|
||||
display: function(value, response) {
|
||||
display: (value, response) => {
|
||||
return false;
|
||||
},
|
||||
success: function(response, newValue) {
|
||||
newValue = parseInt(newValue);
|
||||
const newValueOutput = newValue.toLocaleString() + " ISK";
|
||||
const newValueOutput = `${newValue.toLocaleString()} ISK`;
|
||||
|
||||
$(this).html(`<b>${newValueOutput}</b>`);
|
||||
},
|
||||
@@ -218,11 +219,11 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
|
||||
}
|
||||
});
|
||||
|
||||
elementEditableSrpAmount.on('hidden', function(e, reason){
|
||||
if(reason === 'save' || reason === 'nochange') {
|
||||
elementEditableSrpAmount.on('hidden', function(e, reason) {
|
||||
if (reason === 'save' || reason === 'nochange') {
|
||||
const next_editable_element = $(this).closest('tr').next().find('.editable');
|
||||
|
||||
setTimeout(function() {
|
||||
setTimeout(() => {
|
||||
next_editable_element.editable('show');
|
||||
}, 400);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user