From 182b594c1c596290a059dac0c649712ccd03697c Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 13 Dec 2013 11:50:20 +0000 Subject: [PATCH] 2013-12-13 Sergio Martin * 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 --- pandora_console/ChangeLog | 6 ++ pandora_console/mobile/operation/agents.php | 15 ++- pandora_console/mobile/operation/events.php | 32 ++++-- pandora_console/mobile/operation/modules.php | 100 ++++++++++--------- 4 files changed, 93 insertions(+), 60 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 6b1245c749..1c49efe8da 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-12-13 Sergio Martin + + * 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 * include/graphs/flot/pandora.flot.js: Fixed wrong diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index 12fb443a40..88f3aef88c 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -354,9 +354,9 @@ class Agents { $ui->contentAddHtml(""); diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index d24bf8b036..8c0c8cc463 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -70,7 +70,7 @@ class Events { $events = array(); $end = 1; - foreach ($events_db as $event) { + foreach ($events_db as $event) { $end = 0; switch ($event['estado']) { @@ -88,27 +88,27 @@ class Events { if($event['criticity'] == EVENT_CRIT_WARNING) { $img_st = str_replace("white.png", "dark.png", $img_st); } - + $status_icon = html_print_image($img_st, true); $open_link = ''; $close_link = ''; - if (!$this->readOnly) { + if (!$this->readOnly) { $open_link = '
'; - $close_link = '
'; + $close_link = ''; } $row = array(); $row[] = $open_link . '' . __('Event Name') . '' . io_safe_output($event['evento']) . $close_link; - + if ($event["id_agente"] == 0) { $agent_name = __('System'); } else { $agent_name = '' . ui_print_agent_name ($event["id_agente"], true, 'agent_small', '', false, '', '', false, false) . ''; } - + $row_1 = $open_link; $row_1 .= '' . __('Agent') . '' . $agent_name . ''; $row_1 .= '' . $status_icon . '
' . ui_print_timestamp ($event['timestamp_rep'], true) . '
'; @@ -912,7 +912,7 @@ class Events { function ajax_load_rows() { if (load_more_rows) { - + load_more_rows = 0; postvars = {}; @@ -933,7 +933,7 @@ class Events { postvars, function (data) { add_rows(data); - + //For large screens load the new events if (document.documentElement.scrollHeight == document.documentElement.clientHeight) { ajax_load_rows(); @@ -944,14 +944,24 @@ class Events { } $(document).ready(function() { + ajax_load_rows(); + $(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)) { ajax_load_rows(); } - }); - }); + } "); } diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index ea1361c1fc..67eed87b5c 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -593,54 +593,62 @@ class Modules { $ui->contentAddHtml("");