jenkins-bot has submitted this change and it was merged.

Change subject: Links: Enable removing target link when clicking on source link
......................................................................


Links: Enable removing target link when clicking on source link

* Modifies removeLink function
* If a source link is clicked, removes the corresponding target link

Bug: T85928
Change-Id: I62caf392f324b519748998e6394c3166da116ca7
---
M modules/tools/ext.cx.tools.link.js
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Santhosh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/tools/ext.cx.tools.link.js 
b/modules/tools/ext.cx.tools.link.js
index afe6e04..a78ff28 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -126,10 +126,19 @@
 
        /**
         * Removes a link if the link is an editable target link
+        * If the link is a source link, removes the corresponding
+        * editable target link.
         * @return {boolean}
         */
        LinkCard.prototype.removeLink = function () {
-               var $parentSection = null;
+               var $targetLink, $parentSection = null;
+
+               if ( this.isSourceLink() ) {
+                       $targetLink = this.getTargetLink();
+                       if ( $targetLink ) {
+                               this.$link = $targetLink.first();
+                       }
+               }
 
                if ( this.isEditableTargetLink() ) {
                        $parentSection = this.$link.parents( 
'[contenteditable]' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I62caf392f324b519748998e6394c3166da116ca7
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Jsahleen <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to