From 36135883ee376169568a442e5180bb9d62a50120 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 20 Aug 2015 14:51:14 +0200 Subject: [PATCH 1/8] div.ajax uses data-view and data-action attributes if set --- styles/bootstrap/application.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 8c7b25397..b440132bb 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -402,15 +402,30 @@ $(document).ready( function() { $('div.ajax').each(function(index) { var element = $(this); - var url = element.data('href'); - console.log('Calling '+url); + var url = ''; + var href = element.data('href'); + var view = element.data('view'); + var action = element.data('action'); + if(view && action) + url = "out."+view+".php?action="+action; + else + url = href; + // console.log('Calling '+url); $.get(url, function(data) { element.html(data); + $(".chzn-select").chosen(); }); }); $('div.ajax').on('update', function(event, param1) { var element = $(this); - var url = element.data('href'); + var url = ''; + var href = element.data('href'); + var view = element.data('view'); + var action = element.data('action'); + if(view && action) + url = "out."+view+".php?action="+action; + else + url = href; if(typeof param1 === 'object') { for(var key in param1) { url += "&"+key+"="+param1[key]; @@ -418,11 +433,11 @@ $(document).ready( function() { } else { url += "&"+param1; } - console.log("Calling: "+url); + // console.log("Calling: "+url); element.prepend('
'); -// element.html('
'); $.get(url, function(data) { element.html(data); + $(".chzn-select").chosen(); }); }); $("body").on("click", ".ajax-click", function() { From f59751aa142ef485a3c07bab6debedbd3eb3b2e6 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 20 Aug 2015 14:52:36 +0200 Subject: [PATCH 2/8] set data-view and data-action in div.ajax tag instead of data-href --- views/bootstrap/class.UsrMgr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.UsrMgr.php b/views/bootstrap/class.UsrMgr.php index a72ce623c..480773c08 100644 --- a/views/bootstrap/class.UsrMgr.php +++ b/views/bootstrap/class.UsrMgr.php @@ -422,7 +422,7 @@ function showUser(selectObj) {
-
+
+
From 0ae71871efed040e1b5748e289ee764658b5d671 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 20 Aug 2015 16:22:05 +0200 Subject: [PATCH 8/8] fix php warning in getProgressBar() --- views/bootstrap/class.Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 9bbbc390f..3da2867b6 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -2002,7 +2002,7 @@ mayscript> $free = 0; $used = 100; } - $html .= ' + $html = '