Merge branch 'feature/widgets' into feature/between_now_and_date

pull/6827/head
Philipp Tessenow 14 years ago
commit 3105db802a
  1. 7
      assets/javascripts/reporting/controls.js
  2. 3
      assets/javascripts/reporting/filters.js
  3. 7
      assets/javascripts/reporting/group_bys.js
  4. 2
      assets/javascripts/reporting/progressbar.js

@ -96,6 +96,9 @@ Reporting.Controls = {
}, },
attach_settings_callback: function (element, callback) { attach_settings_callback: function (element, callback) {
if (element === null) {
return;
}
failureCallback = function (response) { failureCallback = function (response) {
$('result-table').update(""); $('result-table').update("");
Reporting.Controls.default_failure_callback(response); Reporting.Controls.default_failure_callback(response);
@ -130,6 +133,7 @@ Reporting.Controls = {
}; };
Reporting.onload(function () { Reporting.onload(function () {
if ($('query_saved_name') !== null) {
if ($('query_saved_name').getAttribute("data-update-url") !== null) { if ($('query_saved_name').getAttribute("data-update-url") !== null) {
Reporting.Controls.query_name_editor('query_saved_name'); Reporting.Controls.query_name_editor('query_saved_name');
} }
@ -146,10 +150,13 @@ Reporting.onload(function () {
Reporting.Controls.attach_settings_callback($("query-breadcrumb-save"), Reporting.Controls.update_result_table); Reporting.Controls.attach_settings_callback($("query-breadcrumb-save"), Reporting.Controls.update_result_table);
} }
} }
}
Reporting.Controls.observe_click("query-icon-save-as", Reporting.Controls.toggle_save_as_form); Reporting.Controls.observe_click("query-icon-save-as", Reporting.Controls.toggle_save_as_form);
Reporting.Controls.observe_click("query-icon-save-as-cancel", Reporting.Controls.toggle_save_as_form); Reporting.Controls.observe_click("query-icon-save-as-cancel", Reporting.Controls.toggle_save_as_form);
if ($('save_as_form') !== null) {
$('save_as_form').hide(); $('save_as_form').hide();
}
// When saving a new query, the success-response is the new saved query's url -> redirect to that // When saving a new query, the success-response is the new saved query's url -> redirect to that
Reporting.Controls.attach_settings_callback($("query-icon-save-button"), function (response) { Reporting.Controls.attach_settings_callback($("query-icon-save-button"), function (response) {

@ -412,11 +412,14 @@ Reporting.Filters = {
}; };
Reporting.onload(function () { Reporting.onload(function () {
if ($("add_filter_select")) {
$("add_filter_select").observe("change", function () { $("add_filter_select").observe("change", function () {
if (!(Reporting.Filters.exists(this.value))) { if (!(Reporting.Filters.exists(this.value))) {
Reporting.Filters.add_filter(this); Reporting.Filters.add_filter(this);
}; };
}); });
}
$$(".filter_rem").each(function (e) { $$(".filter_rem").each(function (e) {
e.observe("click", function () { e.observe("click", function () {
var filter_name = this.up('tr').getAttribute("data-filter-name"); var filter_name = this.up('tr').getAttribute("data-filter-name");

@ -3,7 +3,10 @@
Reporting.GroupBys = { Reporting.GroupBys = {
group_by_container_ids: function() { group_by_container_ids: function() {
return $w('group_by_columns group_by_rows'); var ids = $w('group_by_columns group_by_rows');
return ids.select(function (i) {
return $(i) !== null
});
}, },
sortable_options: function() { sortable_options: function() {
@ -160,10 +163,12 @@ Reporting.GroupBys = {
Reporting.onload(function () { Reporting.onload(function () {
Reporting.GroupBys.initialize_drag_and_drop_areas(); Reporting.GroupBys.initialize_drag_and_drop_areas();
[$('add_group_by_rows'), $('add_group_by_columns')].each(function (select) { [$('add_group_by_rows'), $('add_group_by_columns')].each(function (select) {
if (select !== null) {
select.observe("change", function () { select.observe("change", function () {
if (!(Reporting.GroupBys.exists(this.value))) { if (!(Reporting.GroupBys.exists(this.value))) {
Reporting.GroupBys.add_group_by_from_select(this); Reporting.GroupBys.add_group_by_from_select(this);
}; };
}); });
}
}); });
}); });

@ -4,7 +4,9 @@
Reporting.Progress = { Reporting.Progress = {
abort: function () { abort: function () {
if (window.progressbar !== undefined && window.progressbar !== null) {
window.progressbar.stop(); window.progressbar.stop();
}
}, },
replace_with_bar: function (element) { replace_with_bar: function (element) {

Loading…
Cancel
Save