Sitic has uploaded a new change for review.
https://gerrit.wikimedia.org/r/220727
Change subject: Stop click event propagation when necessary
......................................................................
Stop click event propagation when necessary
Change-Id: I70738945c55cbd81bbd3fe727b112c0cf940cb9c
---
M frontend/src/app/index.js
M frontend/src/components/watchlist/edit.directive.html
M frontend/src/components/watchlist/page.directive.js
M frontend/src/components/watchlist/user.directive.js
4 files changed, 20 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/labs/tools/crosswatch
refs/changes/27/220727/1
diff --git a/frontend/src/app/index.js b/frontend/src/app/index.js
index 7fd5700..aa7d01a 100644
--- a/frontend/src/app/index.js
+++ b/frontend/src/app/index.js
@@ -16,6 +16,7 @@
.config(locationConfig)
.config(storageConfig)
.factory('socket', socketFactory)
+ .directive('stopEvent', stopEventDirective)
;
function routeConfig ($routeProvider) {
@@ -57,3 +58,17 @@
url: sockjsUrl
});
}
+
+/**
+ * Stop click event propagation
+ */
+function stopEventDirective() {
+ return {
+ restrict: 'A',
+ link: function (scope, element, attr) {
+ element.bind('click', function (e) {
+ e.stopPropagation();
+ });
+ }
+ };
+}
diff --git a/frontend/src/components/watchlist/edit.directive.html
b/frontend/src/components/watchlist/edit.directive.html
index fc01176..85d543f 100644
--- a/frontend/src/components/watchlist/edit.directive.html
+++ b/frontend/src/components/watchlist/edit.directive.html
@@ -1,10 +1,10 @@
<span class="newpage" ng-if="::event.new" translate="NEWPAGE_FLAG"></span
><span class="minoredit" ng-if="::event.minor"
>translate="MINOREDIT_FLAG"></span
><span class="botedit" ng-if="::event.bot" translate="BOTEDIT_FLAG"></span>
-<a
ng-href="{{::event.projecturl}}/w/index.php?oldid={{::event.old_revid}}&diff={{::event.revid}}"
+<a
href="{{::event.projecturl}}/w/index.php?oldid={{::event.old_revid}}&diff={{::event.revid}}"
ng-class="::event.titlestyle" target="_blank">{{::event.title}}</a>
<span ng-if="event.clicked">
- (<a href="{{::event.projecturl}}/w/index.php?title={{::event.title |
urlEncode}}&action=history" translate="HISTORY"></a>)
+ (<a stop-event
href="{{::event.projecturl}}/w/index.php?title={{::event.title |
urlEncode}}&action=history" target="_blank" translate="HISTORY"></a>)
</span>
<span ng-class="::event.bytestyle">({{::event.bytes}})</span>
<div>
diff --git a/frontend/src/components/watchlist/page.directive.js
b/frontend/src/components/watchlist/page.directive.js
index 52f86f5..f7b42f8 100644
--- a/frontend/src/components/watchlist/page.directive.js
+++ b/frontend/src/components/watchlist/page.directive.js
@@ -8,7 +8,7 @@
scope: true,
template: '<a href="{{::event.projecturl}}/wiki/{{::event.title |
urlEncode}}" target="_blank">{{::event.title}}</a> ' +
'<span ng-if="event.clicked">' +
- '(<a href="{{::event.projecturl}}/w/index.php?title={{::event.title |
urlEncode}}&action=history" translate="HISTORY"></a>)' +
+ '(<a stop-event
href="{{::event.projecturl}}/w/index.php?title={{::event.title |
urlEncode}}&action=history" target="_blank" translate="HISTORY"></a>)' +
'</span>',
restrict: 'E'
};
diff --git a/frontend/src/components/watchlist/user.directive.js
b/frontend/src/components/watchlist/user.directive.js
index 2b3fdad..c5220f8 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:{{::event.user |
urlEncode}}" target="_blank">{{::event.user}}</a> ' +
'<span ng-if="event.clicked">' +
- '(<a
href="{{::event.projecturl}}/wiki/Special:Contributions/{{::event.user |
urlEncode}}" translate="CONTRIBS"></a>)' +
+ '(<a stop-event
href="{{::event.projecturl}}/wiki/Special:Contributions/{{::event.user |
urlEncode}}" target="_blank" translate="CONTRIBS"></a>)' +
'</span>',
restrict: 'E'
};
--
To view, visit https://gerrit.wikimedia.org/r/220727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I70738945c55cbd81bbd3fe727b112c0cf940cb9c
Gerrit-PatchSet: 1
Gerrit-Project: labs/tools/crosswatch
Gerrit-Branch: master
Gerrit-Owner: Sitic <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits