Fix bugs in the developer panel.
This commit is contained in:
parent
dfbd3bb552
commit
5d6a2e831f
1 changed files with 11 additions and 6 deletions
|
@ -3,11 +3,11 @@
|
||||||
function DeveloperPanel(developerAjaxUrl) {
|
function DeveloperPanel(developerAjaxUrl) {
|
||||||
this.setupDeveloperPanel = updateDeveloperPanel;
|
this.setupDeveloperPanel = updateDeveloperPanel;
|
||||||
|
|
||||||
function updateDeveloperPanel() {
|
function updateDeveloperPanel(data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: developerAjaxUrl,
|
url: developerAjaxUrl,
|
||||||
dataType: "json",
|
dataType: "html",
|
||||||
data: collectFormData(),
|
data: data,
|
||||||
complete: function(xhr, status) {
|
complete: function(xhr, status) {
|
||||||
updatePanelContents(xhr.responseText);
|
updatePanelContents(xhr.responseText);
|
||||||
if (document.getElementById("developerPanelSaveButton")) {
|
if (document.getElementById("developerPanelSaveButton")) {
|
||||||
|
@ -29,13 +29,18 @@ function DeveloperPanel(developerAjaxUrl) {
|
||||||
|
|
||||||
function addBehaviorToElements() {
|
function addBehaviorToElements() {
|
||||||
$( "#developerPanelClickMe" ).click(openPanel);
|
$( "#developerPanelClickMe" ).click(openPanel);
|
||||||
$( "#developerPanelSaveButton" ).click(updateDeveloperPanel);
|
$( "#developerPanelSaveButton" ).click(saveSettings);
|
||||||
$( "#developerPanelBody [type=checkbox]" ).change(updateDisabledFields);
|
$( "#developerPanelBody input:checkbox" ).change(updateDisabledFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPanel() {
|
function openPanel() {
|
||||||
$( "#developerPanelClickText" ).hide();
|
$( "#developerPanelClickText" ).hide();
|
||||||
$( "#developerPanelBody" ).css( "display", "block" );
|
$( "#developerPanelBody" ).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveSettings() {
|
||||||
|
$( "#developerPanelBody" ).hide();
|
||||||
|
updateDeveloperPanel(collectFormData());
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateDisabledFields() {
|
function updateDisabledFields() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue