From 5d6a2e831f481e7cfdf61ddf1feae34aabbf13cb Mon Sep 17 00:00:00 2001 From: Jim Blake Date: Tue, 29 Apr 2014 11:56:47 -0400 Subject: [PATCH] Fix bugs in the developer panel. --- webapp/web/js/developer/developerPanel.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/webapp/web/js/developer/developerPanel.js b/webapp/web/js/developer/developerPanel.js index bf14183f9..0e6bf1a81 100644 --- a/webapp/web/js/developer/developerPanel.js +++ b/webapp/web/js/developer/developerPanel.js @@ -3,11 +3,11 @@ function DeveloperPanel(developerAjaxUrl) { this.setupDeveloperPanel = updateDeveloperPanel; - function updateDeveloperPanel() { + function updateDeveloperPanel(data) { $.ajax({ url: developerAjaxUrl, - dataType: "json", - data: collectFormData(), + dataType: "html", + data: data, complete: function(xhr, status) { updatePanelContents(xhr.responseText); if (document.getElementById("developerPanelSaveButton")) { @@ -29,13 +29,18 @@ function DeveloperPanel(developerAjaxUrl) { function addBehaviorToElements() { $( "#developerPanelClickMe" ).click(openPanel); - $( "#developerPanelSaveButton" ).click(updateDeveloperPanel); - $( "#developerPanelBody [type=checkbox]" ).change(updateDisabledFields); + $( "#developerPanelSaveButton" ).click(saveSettings); + $( "#developerPanelBody input:checkbox" ).change(updateDisabledFields); } function openPanel() { $( "#developerPanelClickText" ).hide(); - $( "#developerPanelBody" ).css( "display", "block" ); + $( "#developerPanelBody" ).show(); + } + + function saveSettings() { + $( "#developerPanelBody" ).hide(); + updateDeveloperPanel(collectFormData()); } function updateDisabledFields() {