add SeeddmsAjax for running function after updating div.ajax

This commit is contained in:
Uwe Steinmann 2022-01-05 08:04:38 +01:00
parent 22915df3e1
commit ea5218ea03
2 changed files with 52 additions and 0 deletions

View File

@ -492,6 +492,7 @@ $(document).ready( function() {
}
}
initMost();
SeedDMSAjax.run(view, action);
});
}); /* }}} */
@ -542,6 +543,7 @@ $(document).ready( function() {
}
}
initMost();
SeedDMSAjax.run(view, action);
});
}); /* }}} */
@ -1366,3 +1368,27 @@ $(document).ready(function() { /* {{{ */
timeOutId = setTimeout(SeedDMSTask.run, timeout);
}
}( window.SeedDMSTask = window.SeedDMSTask || {}, jQuery )); /* }}} */
(function( SeedDMSAjax, $, undefined ) { /* {{{ */
var tasks = Array(
{name: 'test', view: 'null', action: null, func:
test = function() {
console.log('Run in SeedDMSAjax');
}
}
);
SeedDMSAjax.add = function(task) {
tasks.push(task);
}
SeedDMSAjax.run = function(view, action) {
for(let task of tasks) {
//console.log('Checking for '+view+':'+action);
if(task.view == null || (task.view == view && task.action == null) || (task.view == view && task.action == action)) {
//console.log('Running '+task.name+' after update for '+view+':'+action);
task.func();
}
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */

View File

@ -523,6 +523,7 @@ $(document).ready( function() {
}
}
initMost();
SeedDMSAjax.run(view, action);
});
}); /* }}} */
@ -573,6 +574,7 @@ $(document).ready( function() {
}
}
initMost();
SeedDMSAjax.run(view, action);
});
}); /* }}} */
@ -1422,3 +1424,27 @@ $(document).ready(function() { /* {{{ */
timeOutId = setTimeout(SeedDMSTask.run, timeout);
}
}( window.SeedDMSTask = window.SeedDMSTask || {}, jQuery )); /* }}} */
(function( SeedDMSAjax, $, undefined ) { /* {{{ */
var tasks = Array(
{name: 'test', view: 'null', action: null, func:
test = function() {
console.log('Run in SeedDMSAjax');
}
}
);
SeedDMSAjax.add = function(task) {
tasks.push(task);
}
SeedDMSAjax.run = function(view, action) {
for(let task of tasks) {
//console.log('Checking for '+view+':'+action);
if(task.view == null || (task.view == view && task.action == null) || (task.view == view && task.action == action)) {
//console.log('Running '+task.name+' after update for '+view+':'+action);
task.func();
}
}
}
}( window.SeedDMSAjax = window.SeedDMSAjax || {}, jQuery )); /* }}} */