Disable the export button until a format is selected

This commit is contained in:
Tom Hughes 2012-03-15 14:50:43 +00:00
parent d29a9dad9d
commit 13a98cf7eb

View file

@ -214,15 +214,15 @@ function validateControls() {
}
var max_scale = maxMapnikScale();
var disabled = true;
if ($("#format_osm").prop("checked") && bounds.getWidth() * bounds.getHeight() > <%= MAX_REQUEST_AREA %>) {
$("#export_commit").prop("disabled", true);
} else if ($("#format_mapnik").prop("checked") && $("#mapnik_scale").val() < max_scale) {
$("#export_commit").prop("disabled", true);
} else {
$("#export_commit").prop("disabled", false);
if ($("#format_osm").prop("checked")) {
disabled = bounds.getWidth() * bounds.getHeight() > <%= MAX_REQUEST_AREA %>;
} else if ($("#format_mapnik").prop("checked")) {
disabled = $("#mapnik_scale").val() < max_scale;
}
$("#export_commit").prop("disabled", disabled);
$("#mapnik_max_scale").html(roundScale(max_scale));
}