From ab8fcb024e9eb424a7ba3431f96fd50bc4cfbbe0 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 11 Feb 2008 19:58:17 +0000 Subject: [PATCH] Correção no contador de registros na ferramenta de listagem da tabela de atributos de um tema --- ferramentas/tabela/index.htm | 2 +- ferramentas/tabela/index.js | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ferramentas/tabela/index.htm b/ferramentas/tabela/index.htm index 52465bd..b4097d4 100644 --- a/ferramentas/tabela/index.htm +++ b/ferramentas/tabela/index.htm @@ -27,7 +27,7 @@
listar: - + até diff --git a/ferramentas/tabela/index.js b/ferramentas/tabela/index.js index f57554e..2a2927a 100644 --- a/ferramentas/tabela/index.js +++ b/ferramentas/tabela/index.js @@ -77,19 +77,27 @@ YAHOO.example.init = function () //conta menos 20 function menosf() { - $i("inicio").value = ($i("inicio").value * 1) - 20 - if ($i("inicio").value < 0) - {$i("inicio").value = 0} - $i("fim").value = ($i("fim").value * 1) - 20 - if ($i("fim").value < 0) - {$i("fim").value = 1} + var i = $i("inicio").value * 1; + var f = $i("fim").value * 1 + var d = f - i; + + $i("inicio").value = i - d - 1 + $i("fim").value = i - 1 + if ($i("inicio").value < 1) + { + $i("inicio").value = 1 + $i("fim").value = 1 + d + } registrosf() } //conta menos 20 function maisf() { - $i("inicio").value = ($i("inicio").value * 1) + 20 - $i("fim").value = ($i("fim").value * 1) + 20 + var i = $i("inicio").value * 1; + var f = $i("fim").value * 1 + var d = f - i; + $i("inicio").value = f + 1 + $i("fim").value = f + d + 1 registrosf() } //lista os registros da tabela @@ -101,7 +109,7 @@ function registrosf() {tiporeg = "mapa"} if ($i("tipolista").checked) {tipolista = "selecionados"} - var inicio=$i("inicio").value + var inicio=$i("inicio").value - 1 var fim=$i("fim").value var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=listaregistros&inicio="+inicio+"&fim="+fim+"&tema="+tema+"&tipo="+tiporeg+"&tipolista="+tipolista var cp = new cpaint(); -- libgit2 0.21.2