summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/static/js/ishtar.js12
-rw-r--r--ishtar_common/templates/blocks/DataTables.html8
-rw-r--r--ishtar_common/templates/ishtar/sheet.html12
3 files changed, 14 insertions, 18 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 31621502d..840d588f3 100644
--- a/ishtar_common/static/js/ishtar.js
+++ b/ishtar_common/static/js/ishtar.js
@@ -275,7 +275,7 @@ function long_wait(){
var last_window;
-function load_window(url, speed, on_success){
+function load_window(url, speed, on_success, no_jump){
$("#progress").show();
$.ajax({
url: url,
@@ -293,10 +293,12 @@ function load_window(url, speed, on_success){
$("#window").append(html);
}
$("#"+last_window).show();
- // jump to this window
- var url = location.href;
- location.href = "#" + last_window;
- history.replaceState(null, null, url);
+ if (!no_jump){
+ // jump to this window
+ var url = location.href;
+ location.href = "#" + last_window;
+ history.replaceState(null, null, url);
+ }
if (on_success) on_success();
},
error:function(XMLHttpRequest, textStatus, errorThrows){
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html
index 38cd4f298..b96e24a49 100644
--- a/ishtar_common/templates/blocks/DataTables.html
+++ b/ishtar_common/templates/blocks/DataTables.html
@@ -104,8 +104,7 @@ jQuery(document).ready(function(){
$("#progress").show();
}
var data = "";
- for (idx in query_vars)
- {
+ for (idx in query_vars){
var key = query_vars[idx];
var item = jQuery("#id_"+key);
var val = null;
@@ -123,6 +122,7 @@ jQuery(document).ready(function(){
}
var mygrid = jQuery("#grid_{{name}}");
var url = "{{source}}?submited=1&" + data;
+ datatable_{{sname}}.ajax.url(url).load();
var csv_url = "{{source}}csv?submited=1&" + data;
$(".{{sname}}-csv").attr("href", csv_url);
var csv_full_url = "{{source_full}}csv?submited=1&" + data;
@@ -131,10 +131,6 @@ jQuery(document).ready(function(){
$(".{{slug}}-csv-full").attr("href", '{{extra_source}}csv?submited=1&' + data);
{% endfor %}
- {% comment %}
- mygrid.setGridParam({url:url, page:1});
- mygrid.trigger("reloadGrid");
- {% endcomment %}
if ($("#progress").length > 0){
$("#progress").hide();
}
diff --git a/ishtar_common/templates/ishtar/sheet.html b/ishtar_common/templates/ishtar/sheet.html
index 4f118f2f9..80bb1d4d1 100644
--- a/ishtar_common/templates/ishtar/sheet.html
+++ b/ishtar_common/templates/ishtar/sheet.html
@@ -1,8 +1,4 @@
-{% load i18n %}
-{% block main_head %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+{% load i18n %}{% block main_head %}<html lang="en">
<head>
<title>{% block title %}Ishtar{% if APP_NAME %} - {{APP_NAME}}{%endif%}{% endblock %}
</title>
@@ -76,11 +72,13 @@
}
jQuery(".next_page").click(function() {
load_window("{{current_window_url}}" + get_next_table_id({{item.pk}}) + "/",
- '', function(){$("#{{window_id}}").remove();});
+ '', function(){$("#{{window_id}}").remove();},
+ true);
});
jQuery(".previous_page").click(function() {
load_window("{{current_window_url}}" + get_previous_table_id({{item.pk}}) + "/",
- '', function(){$("#{{window_id}}").remove();});
+ '', function(){$("#{{window_id}}").remove();},
+ true);
});
});
</script>