Commit a99bad1061482e1da65b7b451cfe96cdc002b059

Authored by Andrew Shvayka
2 parents e51a0486 859ab1ef

Merge branch 'master' of github.com:thingsboard/thingsboard

... ... @@ -139,6 +139,11 @@ export default function EntityStateController($scope, $location, $state, $stateP
139 139 var params = vm.stateObject[index].params;
140 140 var entityName = params && params.entityName ? params.entityName : '';
141 141 result = utils.insertVariable(stateName, 'entityName', entityName);
  142 + for (var prop in params) {
  143 + if (params[prop] && params[prop].entityName) {
  144 + result = utils.insertVariable(stateName, prop + ':entityName', params[prop].entityName);
  145 + }
  146 + }
142 147 }
143 148 return result;
144 149 }
... ... @@ -163,7 +168,7 @@ export default function EntityStateController($scope, $location, $state, $stateP
163 168 );
164 169 }
165 170 } else {
166   - deferred.reject();
  171 + deferred.resolve('');
167 172 }
168 173 return deferred.promise;
169 174 }
... ...
... ... @@ -26,8 +26,9 @@ const pinSvg = `<svg class="image-map-pin-image" xmlns="http://www.w3.org/2000/s
26 26
27 27 export default class TbImageMap {
28 28
29   - constructor($containerElement, initCallback, imageUrl, posFunction) {
  29 + constructor(ctx, $containerElement, initCallback, imageUrl, posFunction) {
30 30
  31 + this.ctx = ctx;
31 32 this.tooltips = [];
32 33
33 34 $containerElement.append('<div id="image-map-container"><div id="image-map"></div></div>');
... ... @@ -195,7 +196,7 @@ export default class TbImageMap {
195 196 }
196 197
197 198 createTooltip(marker, pattern, replaceInfo, markerArgs) {
198   - var popup = new Popup(marker.pinElement);
  199 + var popup = new Popup(this.ctx, marker.pinElement);
199 200 popup.setContent('');
200 201 this.tooltips.push( {
201 202 markerArgs: markerArgs,
... ... @@ -271,7 +272,7 @@ class Position {
271 272 }
272 273
273 274 class Popup {
274   - constructor(anchor) {
  275 + constructor(ctx, anchor) {
275 276 anchor.tooltipster(
276 277 {
277 278 theme: 'tooltipster-shadow',
... ... @@ -287,9 +288,11 @@ class Popup {
287 288 this.tooltip = anchor.tooltipster('instance');
288 289 var contentElement = angular.element('<div class="image-map-pin-tooltip">' +
289 290 '<a class="image-map-pin-tooltip-close-button" id="close" style="outline: none;">×</a>' +
290   - '<div flex id="tooltip-content" layout="column">' +
  291 + '<div id="tooltip-content">' +
291 292 '</div>' +
292 293 '</div>');
  294 + var $compile = ctx.$scope.$injector.get('$compile');
  295 + $compile(contentElement)(ctx.$scope);
293 296 var popup = this;
294 297 contentElement.find('#close').on('click', function() {
295 298 popup.tooltip.close();
... ...
... ... @@ -79,7 +79,7 @@ export default class TbMapWidgetV2 {
79 79 } else if (mapProvider === 'openstreet-map') {
80 80 this.map = new TbOpenStreetMap($element, initCallback, this.defaultZoomLevel, this.dontFitMapBounds, minZoomLevel);
81 81 } else if (mapProvider === 'image-map') {
82   - this.map = new TbImageMap($element, initCallback, settings.mapImageUrl, settings.posFunction);
  82 + this.map = new TbImageMap(this.ctx, $element, initCallback, settings.mapImageUrl, settings.posFunction);
83 83 }
84 84 }
85 85
... ...