Browse Source

Method signatures in the 'Copy HTML link' option

CrazyDoctor 3 months ago
parent
commit
7fc819e20a
1 changed files with 3 additions and 4 deletions
  1. 3 4
      static/page/class/script.js

+ 3 - 4
static/page/class/script.js

@@ -1134,6 +1134,7 @@ class ClassPage {
 			const propertyItemParent = target.getAttribute(ClassPage.Attributes.DataPropertyParent);
 			const propertyItemDynamic = target.getAttribute(ClassPage.Attributes.DataPropertyDynamic);
 			const propertyItemInhertied = target.getAttribute(ClassPage.Attributes.DataPropertyInherited);
+			const propertyVisualName = target.getFirstChild('.property-item-name-span').getValue();
 
 			if(propertyItemInhertied !== 'true') {
 				this.createContextMenuItem('ShowInEditor', 'Show in Editor', () => {
@@ -1158,11 +1159,9 @@ class ClassPage {
 			});
 			this.createContextMenuDelimiter();
 			this.createContextMenuItem('CopyHtmlLink', 'Copy HTML link', () => {
-				let linkText = propertyItemName;
+				let linkText = propertyVisualName;
 				if(propertyItemName.startsWith(ClassPage.__static__))
-						linkText = `${Class[ClassPage.ClassProperties.ShortName] || Class[ClassPage.ClassProperties.Name]}.${propertyItemName.replace(ClassPage.__static__, '')}`;
-				if(propertyItemType === 'method')
-						linkText = `${linkText}()`;
+						linkText = `${Class[ClassPage.ClassProperties.ShortName] || Class[ClassPage.ClassProperties.Name]}.${propertyVisualName}`;
 				DOM.copyToClipboard(`<a href="${Url.getPath()}#${propertyItemType === 'method' ? 'Methods' : 'Properties'}:${propertyItemName}">${linkText}</a>`);
 			});
 			break;