mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-10 17:38:41 +00:00
continue implementations
This commit is contained in:
parent
ca6031ee45
commit
06d5918ca3
22
Model/Action/Dom/Redirect.js
Normal file
22
Model/Action/Dom/Redirect.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { UriFactory } from '../../../Uri/UriFactory.js';
|
||||
|
||||
/**
|
||||
* Redirect.
|
||||
*
|
||||
* @param {Object} action Action data
|
||||
* @param {function} callback Callback
|
||||
* @param {string} id Action element
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function redirectMessage (action, callback, id)
|
||||
{
|
||||
setTimeout(function ()
|
||||
{
|
||||
if (data.src) {
|
||||
document.getElementById(data.src).src = UriFactory.build(data.uri);
|
||||
} else {
|
||||
window.location = UriFactory.build(data.uri);
|
||||
}
|
||||
}, parseInt(data.delay));
|
||||
};
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import { UriFactory } from '../../../Uri/UriFactory.js';
|
||||
|
||||
/**
|
||||
* Reload page.
|
||||
*
|
||||
|
|
@ -12,7 +14,16 @@ export function reloadButtonAction (action, callback, id)
|
|||
'use strict';
|
||||
|
||||
setTimeout(function () {
|
||||
document.location.reload(true);
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
import { UriFactory } from '../../Uri/UriFactory.js';
|
||||
|
||||
/**
|
||||
* Redirect.
|
||||
*
|
||||
* @param {{delay:number},{uri:string}} data Message data
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function redirectMessage (data)
|
||||
{
|
||||
setTimeout(function ()
|
||||
{
|
||||
/** global: jsOMS */
|
||||
window.location = UriFactory.build(data.uri);
|
||||
}, parseInt(data.delay));
|
||||
};
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
/**
|
||||
* Reload page.
|
||||
*
|
||||
* @param {{delay:number}} data Message data
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
export function reloadMessage (data) {
|
||||
setTimeout(function () {
|
||||
document.location.reload();
|
||||
}, parseInt(data.delay));
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user