diff --git a/views/bootstrap/styles/application.js b/views/bootstrap/styles/application.js index db29c60f0..6795d4586 100644 --- a/views/bootstrap/styles/application.js +++ b/views/bootstrap/styles/application.js @@ -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 )); /* }}} */ diff --git a/views/bootstrap4/styles/application.js b/views/bootstrap4/styles/application.js index 80ea3ae7d..a404f2def 100644 --- a/views/bootstrap4/styles/application.js +++ b/views/bootstrap4/styles/application.js @@ -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 )); /* }}} */