Sitic has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/223350

Change subject: Fix logevent isolate scope
......................................................................

Fix logevent isolate scope

Scope for logevents was not properly isolated, causing it to
overwrite the parent scope.

Change-Id: I1d1f797edc4b26636339b84504c7206cf028d036
---
M frontend/src/components/watchlist/logevent.directive.js
M frontend/src/components/watchlist/user.directive.js
2 files changed, 5 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/tools/crosswatch 
refs/changes/50/223350/1

diff --git a/frontend/src/components/watchlist/logevent.directive.js 
b/frontend/src/components/watchlist/logevent.directive.js
index 1154cf0..a9fc168 100644
--- a/frontend/src/components/watchlist/logevent.directive.js
+++ b/frontend/src/components/watchlist/logevent.directive.js
@@ -5,7 +5,6 @@
 function watchlistLogevent() {
   var directive = {
     link: link,
-    scope: true,
     templateUrl: 'components/watchlist/logevent.directive.html',
     restrict: 'E'
   };
diff --git a/frontend/src/components/watchlist/user.directive.js 
b/frontend/src/components/watchlist/user.directive.js
index c5220f8..8390640 100644
--- a/frontend/src/components/watchlist/user.directive.js
+++ b/frontend/src/components/watchlist/user.directive.js
@@ -6,9 +6,9 @@
   var directive = {
     link: link,
     scope: true,
-    template: '<a href="{{::event.projecturl}}/wiki/User:{{::event.user | 
urlEncode}}" target="_blank">{{::event.user}}</a> ' +
+    template: '<a href="{{::event.projecturl}}/wiki/User:{{::user | 
urlEncode}}" target="_blank">{{::user}}</a> ' +
     '<span ng-if="event.clicked">' +
-    '(<a stop-event 
href="{{::event.projecturl}}/wiki/Special:Contributions/{{::event.user | 
urlEncode}}" target="_blank" translate="CONTRIBS"></a>)' +
+    '(<a stop-event 
href="{{::event.projecturl}}/wiki/Special:Contributions/{{::user | urlEncode}}" 
target="_blank" translate="CONTRIBS"></a>)' +
     '</span>',
     restrict: 'E'
   };
@@ -16,9 +16,9 @@
 
   function link(scope, element, attrs) {
     if (typeof attrs.name !== 'undefined') {
-      scope.event.user = attrs.name;
+      scope.user = attrs.name;
+    } else {
+      scope.user = scope.event.user;
     }
-
-    scope.event.user = scope.event.user.replace("User:", "");
   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/223350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d1f797edc4b26636339b84504c7206cf028d036
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/crosswatch
Gerrit-Branch: master
Gerrit-Owner: Sitic <jan.leb...@online.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to