Commit 5245c953 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

lint issues

parent 256564ad
......@@ -536,7 +536,7 @@ ServerConnector.setOverlayResultIds = function(overlayName, ids) {
ServerConnector.sendOverlayDetailDataRequest = function(overlayName, identifiedElement, general) {
var overlay = ServerConnector._overlays[overlayName];
if (overlay === undefined) {
throw new Overlay("Unknown overlay: " + overlayName);
throw new Error("Unknown overlay: " + overlayName);
}
var functions = ServerConnector._overlayMethods[overlayName];
if (functions !== undefined) {
......@@ -1072,7 +1072,7 @@ ServerConnector.getLightAliases = function(aliasIds, projectId) {
return this.getAliases(aliasIds,projectId,"id,bounds,modelId");
};
ServerConnector.getSessionData = function(aliasIds, projectId) {
ServerConnector.getSessionData = function() {
if (this._sessionData===undefined) {
this._sessionData = new SessionData();
}
......
......@@ -440,7 +440,7 @@ CustomMap.prototype.refreshComments = function() {
for ( var overlayName in this.overlayCollections) {
if (this.overlayCollections.hasOwnProperty(overlayName) && overlayName === "comment") {
var collection = this.overlayCollections[overlayName];
self.clearOverlayCollection(collection)
self.clearOverlayCollection(collection);
if (ServerConnector.getSessionData().getShowComments()) {
return collection.refresh().then(function(){
return self.renderOverlayCollection({overlayCollection:collection});
......@@ -1725,7 +1725,7 @@ CustomMap.prototype.getTopOverviewImage = function() {
CustomMap.prototype.addControl = function(element) {
if (this._controls[element.id] !== undefined) {
throw new Error("Element with id "+element.id+" already added to controls");
};
}
if (ControlType[element.id]===undefined) {
throw new Error("Unknown control type: "+element.id);
}
......
......@@ -23,5 +23,6 @@ describe('SessionData', function() {
assert.ok(session.getShowComments());
session.setShowComments(false);
assert.notOk(session.getShowComments());
assert.equal(logger.getWarnings().length, 0);
});
});
......@@ -4,7 +4,6 @@ var Helper = require('../../Helper');
var logger = require('../../logger');
var CommentDbOverlay = require('../../../../main/js/map/overlay/CommentDbOverlay');
var OverlayCollection = require('../../../../main/js/map/overlay/OverlayCollection');
var assert = require('assert');
......@@ -22,6 +21,8 @@ describe('CommentDbOverlay', function() {
});
assert.ok(oc);
assert.equal(oc.getName(), 'test name');
assert.equal(logger.getWarnings.length, 0);
});
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment