2013-12-13 Sergio Martin <sergio.martin@artica.es>

* mobile/operation/events.php, mobile/operation/modules.php,
	mobile/operation/agents.php: fixed the scroll of list for old
	browser in android mobiles devices.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9223 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-12-13 11:50:20 +00:00
parent 6a0212c5d4
commit 182b594c1c
4 changed files with 93 additions and 60 deletions

View File

@ -1,3 +1,9 @@
2013-12-13 Sergio Martin <sergio.martin@artica.es>
* mobile/operation/events.php, mobile/operation/modules.php,
mobile/operation/agents.php: fixed the scroll of list for old
browser in android mobiles devices.
2013-12-13 Sergio Martin <sergio.martin@artica.es> 2013-12-13 Sergio Martin <sergio.martin@artica.es>
* include/graphs/flot/pandora.flot.js: Fixed wrong * include/graphs/flot/pandora.flot.js: Fixed wrong

View File

@ -354,8 +354,8 @@ class Agents {
$ui->contentAddHtml("<script type=\"text/javascript\"> $ui->contentAddHtml("<script type=\"text/javascript\">
var load_more_rows = 1; var load_more_rows = 1;
var page = 1; var page = 1;
$(document).ready(function() {
$(window).bind(\"scroll\", function () { function custom_scroll() {
if (load_more_rows) { if (load_more_rows) {
if ($(this).scrollTop() + $(this).height() if ($(this).scrollTop() + $(this).height()
@ -404,6 +404,15 @@ class Agents {
\"json\"); \"json\");
} }
} }
}
$(document).ready(function() {
$(window).bind(\"scroll\", function () {
custom_scroll();
});
$(window).on(\"touchmove\", function(event) {
custom_scroll();
}); });
}); });
</script>"); </script>");

View File

@ -944,14 +944,24 @@ class Events {
} }
$(document).ready(function() { $(document).ready(function() {
ajax_load_rows();
$(window).bind(\"scroll\", function () { $(window).bind(\"scroll\", function () {
if ($(this).scrollTop() + $(this).height() custom_scroll();
});
$(window).on(\"touchmove\", function(event) {
custom_scroll();
});
});
function custom_scroll() {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) { >= ($(document).height() - 100)) {
ajax_load_rows(); ajax_load_rows();
} }
}); }
});
</script>"); </script>");
} }

View File

@ -593,54 +593,62 @@ class Modules {
$ui->contentAddHtml("<script type=\"text/javascript\"> $ui->contentAddHtml("<script type=\"text/javascript\">
var load_more_rows = 1; var load_more_rows = 1;
var page = 1; var page = 1;
function custom_scroll() {
if (load_more_rows) {
if ($(this).scrollTop() + $(this).height()
>= ($(document).height() - 100)) {
load_more_rows = 0;
postvars = {};
postvars[\"action\"] = \"ajax\";
postvars[\"parameter1\"] = \"modules\";
postvars[\"parameter2\"] = \"get_modules\";
postvars[\"group\"] = $(\"select[name='group']\").val();
postvars[\"status\"] = $(\"select[name='status']\").val();
postvars[\"type\"] = $(\"select[name='module_group']\").val();
postvars[\"tag\"] = $(\"select[name='tag']\").val();
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
postvars[\"page\"] = page;
page++;
$.post(\"index.php\",
postvars,
function (data) {
if (data.end) {
$(\"#loading_rows\").hide();
}
else {
$.each(data.modules, function(key, module) {
$(\"table#list_Modules tbody\").append(\"<tr>\" +
\"<th class='head_vertical'></th>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[2] + \"</td>\" +
\"<td class='cell_2'><b class='ui-table-cell-label'>" . __('Status') . "</b>\" + module[5] + \"</td>\" +
\"<td class='cell_3'><b class='ui-table-cell-label'>" . __('Interval') . "</b>\" + module[4] + \"</td>\" +
\"<td class='cell_4'><b class='ui-table-cell-label'>" . __('Timestamp') . "</b>\" + module[6] + \"</td>\" +
\"<td class='cell_5'><b class='ui-table-cell-label'>" . __('Data') . "</b>\" + module[7] + \"</td>\" +
\"</tr>\");
});
load_more_rows = 1;
}
},
\"json\");
}
}
}
$(document).ready(function() { $(document).ready(function() {
$(window).bind(\"scroll\", function () { $(window).bind(\"scroll\", function () {
custom_scroll();
});
if (load_more_rows) { $(window).on(\"touchmove\", function(event) {
if ($(this).scrollTop() + $(this).height() custom_scroll();
>= ($(document).height() - 100)) {
load_more_rows = 0;
postvars = {};
postvars[\"action\"] = \"ajax\";
postvars[\"parameter1\"] = \"modules\";
postvars[\"parameter2\"] = \"get_modules\";
postvars[\"group\"] = $(\"select[name='group']\").val();
postvars[\"status\"] = $(\"select[name='status']\").val();
postvars[\"type\"] = $(\"select[name='module_group']\").val();
postvars[\"tag\"] = $(\"select[name='tag']\").val();
postvars[\"free_search\"] = $(\"input[name='free_search']\").val();
postvars[\"page\"] = page;
page++;
$.post(\"index.php\",
postvars,
function (data) {
if (data.end) {
$(\"#loading_rows\").hide();
}
else {
$.each(data.modules, function(key, module) {
$(\"table#list_Modules tbody\").append(\"<tr>\" +
\"<th class='head_vertical'></th>\" +
\"<td class='cell_1'><b class='ui-table-cell-label'>" . __('Module name') . "</b>\" + module[0] + \"</td>\" +
\"<td class='cell_0'><b class='ui-table-cell-label'>" . __('Agent name') . "</b>\" + module[2] + \"</td>\" +
\"<td class='cell_2'><b class='ui-table-cell-label'>" . __('Status') . "</b>\" + module[5] + \"</td>\" +
\"<td class='cell_3'><b class='ui-table-cell-label'>" . __('Interval') . "</b>\" + module[4] + \"</td>\" +
\"<td class='cell_4'><b class='ui-table-cell-label'>" . __('Timestamp') . "</b>\" + module[6] + \"</td>\" +
\"<td class='cell_5'><b class='ui-table-cell-label'>" . __('Data') . "</b>\" + module[7] + \"</td>\" +
\"</tr>\");
});
load_more_rows = 1;
}
},
\"json\");
}
}
}); });
}); });
</script>"); </script>");