mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-10 17:38:41 +00:00
31 lines
947 B
JavaScript
Executable File
31 lines
947 B
JavaScript
Executable File
import { UriFactory } from '../../../Uri/UriFactory.js';
|
|
|
|
/**
|
|
* Reload page.
|
|
*
|
|
* @param {Object} action Action data
|
|
* @param {function} callback Callback
|
|
* @param {string} id Action element
|
|
*
|
|
* @since 1.0.0
|
|
*/
|
|
export function reloadButtonAction (action, callback, id)
|
|
{
|
|
'use strict';
|
|
|
|
setTimeout(function () {
|
|
if (action.src) {
|
|
console.log(document.getElementById(action.src).hasAttribute('data-src'));
|
|
console.log(UriFactory.build(document.getElementById(action.src).getAttribute('data-src')));
|
|
|
|
document.getElementById(action.src).src = document.getElementById(action.src).hasAttribute('data-src')
|
|
? UriFactory.build(document.getElementById(action.src).getAttribute('data-src'))
|
|
: document.getElementById(action.src).src;
|
|
} else {
|
|
document.location.reload();
|
|
}
|
|
}, parseInt(action.delay));
|
|
|
|
callback();
|
|
};
|