Permalink
Browse files

type defaults to kml and is a mandatory field

  • Loading branch information...
1 parent c0d2e42 commit 3151117e1aa4733b99be00a4c969e64f08c49beb @Gabino3 Gabino3 committed Jul 31, 2012
Showing with 9 additions and 5 deletions.
  1. +2 −2 index.html
  2. +7 −3 js/geocamMaps.js
View
4 index.html
@@ -143,10 +143,10 @@
</tr>
<tr>
<td>
- <h3>Type</h3>
+ <h3>Type*</h3>
</td>
<td>
- {{view GeocamResponderMaps.FormInformation placeholder="Type" valueBinding="GeocamResponderMaps.NewFileController.type"}}
+ {{view GeocamResponderMaps.FormInformation placeholder="Type*" valueBinding="GeocamResponderMaps.NewFileController.type"}}
</td>
</tr>
View
10 js/geocamMaps.js
@@ -833,7 +833,7 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
localCopy: null,
complete: false,
name: '',
- type: '',
+ type: 'kml',
description: '',
coverage: '',
creator: '',
@@ -865,6 +865,10 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
alert('Name must be filled in.');
return false;
}
+ else if(this.type == ''){
+ alert('Type must be filled in.');
+ return false;
+ }
else if(!this.acceptTerms){
alert('Must accept terms of service.');
return false;
@@ -909,7 +913,7 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
formData.append("license", this.license);
formData.append("morePermissions", this.morePermissions);
formData.append("acceptTerms", this.acceptTerms);
-
+ console.log(formData);
$.ajax({
url: GeocamResponderMaps.HOST+'api/layers/',
type: 'POST',
@@ -980,7 +984,7 @@ GeocamResponderMaps.NewFileController = Em.ArrayController.create({
this.set('localCopy', null);
this.set('complete', false);
this.set('name', '');
- this.set('type', '');
+ this.set('type', 'kml');
this.set('description', '');
this.set('coverage', '');
this.set('creator', '');

0 comments on commit 3151117

Please sign in to comment.