Merge branch 'feature/widgets' into feature/between_now_and_date

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

@ -96,6 +96,9 @@ Reporting.Controls = {
},
attach_settings_callback: function (element, callback) {
if (element === null) {
return;
}
failureCallback = function (response) {
$('result-table').update("");
Reporting.Controls.default_failure_callback(response);
@ -130,26 +133,30 @@ Reporting.Controls = {
};
Reporting.onload(function () {
if ($('query_saved_name').getAttribute("data-update-url") !== null) {
Reporting.Controls.query_name_editor('query_saved_name');
}
// don't concern ourselves with new queries
if ($('query_saved_name').getAttribute("data-is_new") !== null) {
if ($('query-icon-delete') !== null) {
Reporting.Controls.observe_click("query-icon-delete", Reporting.Controls.toggle_delete_form);
Reporting.Controls.observe_click("query-icon-delete-cancel", Reporting.Controls.toggle_delete_form);
$('delete_form').hide();
if ($('query_saved_name') !== null) {
if ($('query_saved_name').getAttribute("data-update-url") !== null) {
Reporting.Controls.query_name_editor('query_saved_name');
}
// don't concern ourselves with new queries
if ($('query_saved_name').getAttribute("data-is_new") !== null) {
if ($('query-icon-delete') !== null) {
Reporting.Controls.observe_click("query-icon-delete", Reporting.Controls.toggle_delete_form);
Reporting.Controls.observe_click("query-icon-delete-cancel", Reporting.Controls.toggle_delete_form);
$('delete_form').hide();
}
if ($("query-breadcrumb-save") !== null) {
// When saving an update of an exisiting query or apply filters, we replace the table on success
Reporting.Controls.attach_settings_callback($("query-breadcrumb-save"), Reporting.Controls.update_result_table);
if ($("query-breadcrumb-save") !== null) {
// When saving an update of an exisiting query or apply filters, we replace the table on success
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-cancel", Reporting.Controls.toggle_save_as_form);
$('save_as_form').hide();
if ($('save_as_form') !== null) {
$('save_as_form').hide();
}
// 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) {

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

@ -3,7 +3,10 @@
Reporting.GroupBys = {
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() {
@ -160,10 +163,12 @@ Reporting.GroupBys = {
Reporting.onload(function () {
Reporting.GroupBys.initialize_drag_and_drop_areas();
[$('add_group_by_rows'), $('add_group_by_columns')].each(function (select) {
select.observe("change", function () {
if (!(Reporting.GroupBys.exists(this.value))) {
Reporting.GroupBys.add_group_by_from_select(this);
};
});
if (select !== null) {
select.observe("change", function () {
if (!(Reporting.GroupBys.exists(this.value))) {
Reporting.GroupBys.add_group_by_from_select(this);
};
});
}
});
});

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

Loading…
Cancel
Save