Skip to content

Commit c5dce36

Browse files
committed
[fix] Registry Map: fix marker loading
1 parent 5b85b0f commit c5dce36

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

www/plugins/map/js/controllers/registry-controllers.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ function MapRegistryViewController($scope, $filter, $templateCache, $interpolate
8282
};
8383

8484
$scope.loading = true;
85-
$scope.mapId = 'map-wot-' + $scope.$id;
85+
$scope.loadingMarker = true;
86+
$scope.mapId = 'map-registry-' + $scope.$id;
8687

8788
$scope.map = MapUtils.map({
8889
cache: 'map-registry',
@@ -317,12 +318,14 @@ function MapRegistryViewController($scope, $filter, $templateCache, $interpolate
317318
lat: hit.geoPoint.lat,
318319
lng: hit.geoPoint.lon,
319320
getMessageScope: function () {
320-
$scope.loading = true;
321-
$scope.$applyAsync(function() {
322-
angular.extend($scope.formData, hit);
323-
$scope.loading = false;
321+
var scope = $scope.$new();
322+
scope.loadingMarker = true;
323+
scope.formData = {};
324+
scope.$applyAsync(function() {
325+
angular.extend(scope.formData, hit);
326+
scope.loadingMarker = false;
324327
});
325-
return $scope;
328+
return scope;
326329
},
327330
focus: false,
328331
message: pageMarkerTemplate,

www/plugins/map/js/controllers/wot-controllers.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,19 @@ function MapWotViewController($scope, $filter, $templateCache, $interpolate, $ti
338338
lat: hit.geoPoint.lat,
339339
lng: hit.geoPoint.lon,
340340
getMessageScope: function () {
341-
$scope.loadingMarker = true;
342-
$scope.$applyAsync(function() {
343-
$scope.formData = {
341+
var scope = $scope.$new();
342+
scope.loadingMarker = true;
343+
scope.formData = {};
344+
scope.$applyAsync(function() {
345+
scope.formData = {
344346
pubkey: hit.pubkey,
345347
uid: hit.uid,
346348
name: hit.name,
347349
profile: hit
348350
};
349-
$scope.loadingMarker = false;
351+
scope.loadingMarker = false;
350352
});
351-
return $scope;
353+
return scope;
352354
},
353355
focus: false,
354356
message: markerTemplate,

www/plugins/map/templates/registry/popup_marker.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="item no-border no-padding item-avatar "
2-
ng-if="loading">
2+
ng-if="loadingMarker">
33

44
<i class="item-image icon ion-person"></i>
55

@@ -17,7 +17,7 @@ <h4 class="stable-bg col-50">
1717
</div>
1818

1919
<a class="item no-border no-padding item-avatar ink animate-fade-in animate-show-hide ng-hide"
20-
ng-show="!loading"
20+
ng-show="!loadingMarker"
2121
ui-sref="app.view_page({id: formData.id, title: formData.name})">
2222
<i ng-if="formData.avatar" class="item-image avatar" style="background-image: url({{::formData.avatar.src}}"></i>
2323
<i ng-if="!formData.avatar" class="item-image icon cion-page-{{::formData.type}}"></i>
@@ -41,7 +41,7 @@ <h4 ng-if="::formData.city" class="gray" title="{{::formData.city}}">
4141
ng-class="{'ion-arrow-down-b': !showDescription, 'ion-arrow-up-b': showDescription}"
4242
ng-click="showDescription=!showDescription;"
4343
title="{{'PROFILE.DESCRIPTION'|translate}}"
44-
ng-show="!loading && formData.description">
44+
ng-show="!loadingMarker && formData.description">
4545
&nbsp;
4646
</a>
4747
</div>

0 commit comments

Comments
 (0)