From eccf9c2ac7b1c7f73f610a95059aee7aa95d0419 Mon Sep 17 00:00:00 2001
From: Maxime Beauchemin
Date: Mon, 29 Feb 2016 22:36:44 -0800
Subject: [PATCH] [hotfix] saving as new bugfix
---
panoramix/assets/javascripts/explore.js | 26 +++++++++++++++++--
.../assets/javascripts/modules/panoramix.js | 22 ----------------
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/panoramix/assets/javascripts/explore.js b/panoramix/assets/javascripts/explore.js
index 2618492fd8a5b..eb365e4d330a9 100644
--- a/panoramix/assets/javascripts/explore.js
+++ b/panoramix/assets/javascripts/explore.js
@@ -21,13 +21,35 @@ require('../vendor/pygments.css');
require('../node_modules/bootstrap-toggle/css/bootstrap-toggle.min.css');
var slice;
+function prepForm(){
+ var i = 1;
+ // Assigning the right id to form elements in filters
+ $("#filters > div").each(function() {
+ $(this).attr("id", function() {return "flt_" + i;})
+ $(this).find("#flt_col_0")
+ .attr("id", function() {return "flt_col_" + i;})
+ .attr("name", function() {return "flt_col_" + i;});
+ $(this).find("#flt_op_0")
+ .attr("id", function() {return "flt_op_" + i;})
+ .attr("name", function() {return "flt_op_" + i;});
+ $(this).find("#flt_eq_0")
+ .attr("id", function() {return "flt_eq_" + i;})
+ .attr("name", function() {return "flt_eq_" + i;});
+ i++;
+ });
+}
+
+function renderSlice(){
+ prepForm();
+ slice.render();
+}
function initExploreView() {
function druidify(){
$('div.alert').remove();
history.pushState({}, document.title, slice.querystring());
- px.renderSlice();
+ renderSlice();
}
function get_collapsed_fieldsets(){
@@ -227,7 +249,7 @@ $(document).ready(function() {
$('.slice').data('slice', slice);
// call vis render method, which issues ajax
- px.renderSlice();
+ renderSlice();
// make checkbox inputs display as toggles
$(':checkbox')
diff --git a/panoramix/assets/javascripts/modules/panoramix.js b/panoramix/assets/javascripts/modules/panoramix.js
index 38658363472f9..7228b03cd781a 100644
--- a/panoramix/assets/javascripts/modules/panoramix.js
+++ b/panoramix/assets/javascripts/modules/panoramix.js
@@ -240,27 +240,6 @@ var px = (function() {
console.error("require(", visType, ") failed.");
}
}
- function prepForm(){
- var i = 1;
- // Assigning the right id to form elements in filters
- $("#filters > div").each(function() {
- $(this).attr("id", function() {return "flt_" + i;})
- $(this).find("#flt_col_0")
- .attr("id", function() {return "flt_col_" + i;})
- .attr("name", function() {return "flt_col_" + i;});
- $(this).find("#flt_op_0")
- .attr("id", function() {return "flt_op_" + i;})
- .attr("name", function() {return "flt_op_" + i;});
- $(this).find("#flt_eq_0")
- .attr("id", function() {return "flt_eq_" + i;})
- .attr("name", function() {return "flt_eq_" + i;});
- i++;
- });
- }
- function renderSlice(){
- prepForm();
- slice.render();
- }
// Export public functions
return {
@@ -269,7 +248,6 @@ var px = (function() {
formatDate: formatDate,
timeFormatFactory: timeFormatFactory,
color: color(),
- renderSlice: renderSlice,
getParam: getParam,
}
})();