|
@@ -50,15 +50,18 @@ DataUtils = function(){
|
|
|
* Request creation of an instance of __typeToCreate at the specified
|
|
|
* x and y coordinates
|
|
|
*/
|
|
|
- this.create = function(x,y){
|
|
|
- if( __typeToCreate != undefined )
|
|
|
- HttpUtils.httpReq(
|
|
|
- 'POST',
|
|
|
- HttpUtils.url(__typeToCreate+'.type',__NO_USERNAME),
|
|
|
- {'pos':[x,y]});
|
|
|
- else
|
|
|
- WindowManagement.openDialog(_ERROR,'you must select a type to create');
|
|
|
- };
|
|
|
+ this.create = function (x, y, callback) {
|
|
|
+ if (__typeToCreate == undefined) {
|
|
|
+ WindowManagement.openDialog(_ERROR, 'you must select a type to create');
|
|
|
+ } else {
|
|
|
+ HttpUtils.httpReq(
|
|
|
+ 'POST',
|
|
|
+ HttpUtils.url(__typeToCreate + '.type', __NO_USERNAME),
|
|
|
+ {'pos': [x, y]},
|
|
|
+ callback);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* Deletes the current selection entities
|