]> dev.renevier.net Git - syj.git/commitdiff
some jslint cleanup
authorarno <arno@renevier.net>
Sat, 14 Aug 2010 13:52:18 +0000 (15:52 +0200)
committerarno <arno@renevier.net>
Sat, 14 Aug 2010 13:52:18 +0000 (15:52 +0200)
public/js/syj.js
public/js/utils.js

index 4032cca7989f10060fcbd970f7528f016bedee82..190cc76ee4d7a192aa56cb298cad4289c7b99f96 100644 (file)
@@ -243,32 +243,32 @@ var SYJView = {
         this.map.addLayers([baseLayer, this.viewLayer]);
 
         if ($("edit-btn")) {
-            $("edit-btn").observe('click', (function() {
+            $("edit-btn").observe('click', function() {
                 $("geom_submit").value = SyjStrings.editAction;
                 this.messenger.hide();
                 this.editMode();
                 this.mode = 'edit';
-            }).bind(this));
+            }.bind(this));
         }
 
         if ($("create-btn")) {
-            $("create-btn").observe('click', (function() {
+            $("create-btn").observe('click', function() {
                 $("geom_submit").value = SyjStrings.createAction;
                 this.messenger.hide();
                 this.editMode();
                 this.mode = 'create';
-            }).bind(this));
+            }.bind(this));
         }
 
         if ($("clone-btn")) {
-            $("clone-btn").observe('click', (function() {
+            $("clone-btn").observe('click', function() {
                 $("geom_submit").value = SyjStrings.cloneAction;
                 $("geom_title").value = "";
                 this.messenger.hide();
                 this.editMode();
                 this.mode = 'create';
                 SyjSaveUI.enableSubmit();
-            }).bind(this));
+            }.bind(this));
         }
 
         $("geomform").ajaxize({
@@ -394,12 +394,11 @@ var SYJView = {
             return;
         }
 
-        var self = this;
         this.editControl = new OpenLayers.Control.DrawFeature(new OpenLayers.Layer.Vector(), OpenLayers.Handler.SyjModifiablePath, {
             callbacks: {
                 modify: function(f, line) {
-                    if (!self.unsavedRoute) {
-                        self.unsavedRoute = {};
+                    if (!SYJView.unsavedRoute) {
+                        SYJView.unsavedRoute = {};
                     }
                     if (this.handler.realPoints.length < 2) {
                         SyjSaveUI.show().disable();
@@ -986,4 +985,4 @@ window.onbeforeunload = function() {
     } else {
         return undefined;
     }
-}
+};
index 7126e335410139767a80e7f4890b58461a5270ca..588a85b590e2af6303225f47b478b7c62ce1837f 100644 (file)
@@ -119,12 +119,12 @@ Ajax.TimedRequest = Class.create(Ajax.Request, {
     },
 
     request: function($super, url) {
-        this.timeout = (function() {
+        this.timeout = function() {
             if (this.options.onFailure) {
                 this.options.onFailure(null);
             }
             this.abort();
-        }).bind(this).delay(this.delay);
+        }.bind(this).delay(this.delay);
         $super(url);
     }
 });