Skip to content

Commit

Permalink
Fix function apply, better no value
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Oct 25, 2018
1 parent b57022d commit 776eca6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions contribs/gmf/src/raster/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ exports.directive('gmfElevation', exports.component_);
* @param {!angular.$filter} $filter Angular filter.
* @param {!ngeox.miscDebounce} ngeoDebounce Ngeo debounce factory
* @param {!gmf.raster.RasterService} gmfRaster Gmf Raster service
* @param {!angularGettext.Catalog} gettextCatalog Gettext catalog.
* @constructor
* @private
* @ngInject
* @ngdoc controller
* @ngname gmfElevationController
*/
exports.Controller_ = function($scope, $filter, ngeoDebounce, gmfRaster) {
exports.Controller_ = function($scope, $filter, ngeoDebounce, gmfRaster, gettextCatalog) {

/**
* @type {!angular.$filter}
Expand All @@ -153,6 +154,12 @@ exports.Controller_ = function($scope, $filter, ngeoDebounce, gmfRaster) {
*/
this.gmfRaster_ = gmfRaster;

/**
* @type {angularGettext.Catalog}
* @private
*/
this.gettextCatalog = gettextCatalog;

/**
* @type {!Object.<string, gmf.raster.component.LayerConfig>}
* @private
Expand Down Expand Up @@ -281,9 +288,10 @@ exports.Controller_.prototype.getRasterSuccess_ = function(resp) {
const separator = postfix.length > 0 ?
(options.hasOwnProperty('separator') ? options.separator : '\u00a0') : '';
const args = Array.prototype.concat([value], custom_args);
this.elevation = this.filter_(filter).apply(args) + separator + postfix;
this.elevation = this.filter_(filter).apply(undefined, args) + separator + postfix;
} else {
this.elevation = undefined;
const gettextCatalog = this.gettextCatalog;
this.elevation = gettextCatalog.getString('No value');
}
this.loading = false;
};
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/src/raster/widgetComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span class="gmf-elevationwidget-value">
{{ctrl.elevationValue}}
<span ng-show="ctrl.elevationLoading" class="fa fa-spinner"></span>
<span ng-show="!ctrl.elevationValue && !ctrl.elevationLoading" translate>Elevation…</span>
<span ng-show="!ctrl.elevationValue == undefined && !ctrl.elevationLoading" translate>Elevation…</span>
</span><span class="caret" ng-if="::ctrl.layers.length > 1"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right" role="menu"
Expand Down

0 comments on commit 776eca6

Please sign in to comment.