Skip to content

Commit

Permalink
Apply pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kuenzli committed Feb 12, 2018
1 parent 3857522 commit 0a921c7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions contribs/gmf/src/directives/displayquerygrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ gmf.displayquerygridComponent = {
'removeEmptyColumnsFn': '&?gmfDisplayquerygridRemoveemptycolumns',
'maxResultsFn': '&?gmfDisplayquerygridMaxresults',
'maxRecenterZoomFn': '&?gmfDisplayquerygridMaxrecenterzoom',
'mergeTabs': '=?gmfDisplayquerygridMergetabs'
'mergeTabs': '<?gmfDisplayquerygridMergetabs'
},
templateUrl: gmfDisplayquerygridTemplateUrl
};
Expand Down Expand Up @@ -212,9 +212,8 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng

/**
* @type {!gmfx.GridMergeTabs}
* @private
*/
this.mergeTabs_ = {};
this.mergeTabs = {};

/**
* A mapping between row uid and the corresponding feature for each
Expand Down Expand Up @@ -274,7 +273,7 @@ gmf.DisplayquerygridController = function($injector, $scope, ngeoQueryResult, ng
gmf.DisplayquerygridController.prototype.$onInit = function() {
this.removeEmptyColumns_ = this['removeEmptyColumnsFn'] ? this['removeEmptyColumnsFn']() === true : false;
this.maxRecenterZoom = this['maxRecenterZoomFn'] ? this['maxRecenterZoomFn']() : undefined;
this.mergeTabs_ = this['mergeTabs'] ? this['mergeTabs'] : {};
this.mergeTabs = this['mergeTabs'] ? this['mergeTabs'] : {};

const featuresOverlay = this.ngeoFeatureOverlayMgr_.getFeatureOverlay();
featuresOverlay.setFeatures(this.features_);
Expand Down Expand Up @@ -339,7 +338,7 @@ gmf.DisplayquerygridController.prototype.updateData_ = function() {
this.pending = false;
let sources = this.ngeoQueryResult.sources;
// merge sources if requested
if (Object.keys(this.mergeTabs_).length > 0) {
if (Object.keys(this.mergeTabs).length > 0) {
sources = this.getMergedSources_(sources);
}

Expand Down Expand Up @@ -456,8 +455,8 @@ gmf.DisplayquerygridController.prototype.getMergedSources_ = function(sources) {
gmf.DisplayquerygridController.prototype.getMergedSource_ = function(source, mergedSources) {
let mergeSourceId = null;

for (const currentMergeSourceId in this.mergeTabs_) {
const sourceLabels = this.mergeTabs_[currentMergeSourceId];
for (const currentMergeSourceId in this.mergeTabs) {
const sourceLabels = this.mergeTabs[currentMergeSourceId];
const containsSource = sourceLabels.some(sourceLabel => sourceLabel == source.label);
if (containsSource) {
mergeSourceId = currentMergeSourceId;
Expand Down

0 comments on commit 0a921c7

Please sign in to comment.