From 17ac0916d7f99be6c7568f0100e5bd628b52124d Mon Sep 17 00:00:00 2001 From: arno Date: Sat, 14 Aug 2010 15:52:18 +0200 Subject: [PATCH] some jslint cleanup --- public/js/syj.js | 19 +++++++++---------- public/js/utils.js | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/public/js/syj.js b/public/js/syj.js index 4032cca..190cc76 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -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; } -} +}; diff --git a/public/js/utils.js b/public/js/utils.js index 7126e33..588a85b 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -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); } }); -- 2.39.2