Skip to content
Snippets Groups Projects
Commit 1e4275cf authored by Piotr Gawron's avatar Piotr Gawron
Browse files

rename of method to better show responsibility

parent a2bc0891
No related branches found
No related tags found
1 merge request!5Frontend refactor
......@@ -130,11 +130,7 @@ CustomMap.prototype.clearOverlays = function() {
for ( var overlayName in this.overlayCollections) {
if (this.overlayCollections.hasOwnProperty(overlayName)) {
var collection = this.overlayCollections[overlayName];
if (collection.constructor.name === "OverlayCollection") {
this.clearOverlayCollection(collection);
} else {
collection.clear();
}
collection.clear();
}
}
};
......@@ -145,7 +141,7 @@ CustomMap.prototype.clearOverlays = function() {
* @param collection
* {@link OverlayCollection} from which all markers should be removed
*/
CustomMap.prototype.clearOverlayCollection = function(collection) {
CustomMap.prototype.hideMarkersForOverlayCollection = function(collection) {
logger.debug("Clear collection: " + collection.name);
for ( var aliasKey in collection.aliasMarkers) {
if (collection.aliasMarkers.hasOwnProperty(aliasKey) && collection.aliasMarkers[aliasKey] !== undefined
......@@ -183,7 +179,7 @@ CustomMap.prototype.clearOverlayCollection = function(collection) {
* after update, <code>false</code> otherwise
*/
CustomMap.prototype.updateOverlayCollection = function(overlayCollection, fitBounds) {
this.clearOverlayCollection(overlayCollection);
this.hideMarkersForOverlayCollection(overlayCollection);
return this.renderOverlayCollection({
overlayCollection : overlayCollection,
fitBounds : fitBounds
......@@ -307,7 +303,7 @@ CustomMap.prototype.refreshComments = function() {
var collection = self.getOverlayByName("comment");
if (collection !== undefined) {
self.clearOverlayCollection(collection);
self.hideMarkersForOverlayCollection(collection);
if (ServerConnector.getSessionData(self.getProject()).getShowComments()) {
return collection.refresh().then(function() {
return self.renderOverlayCollection({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment