Skip to content

Fix Add Link OK button not working in device notes editor#1655

Open
lacatoire wants to merge 1 commit intoopendcim:masterfrom
lacatoire:fix/1431-device-notes-link-button
Open

Fix Add Link OK button not working in device notes editor#1655
lacatoire wants to merge 1 commit intoopendcim:masterfrom
lacatoire:fix/1431-device-notes-link-button

Conversation

@lacatoire
Copy link

@lacatoire lacatoire commented Feb 10, 2026

Summary

  • Fixed the "Add Link" OK button doing nothing when entering a web address in device notes
  • The jQuery TE editor's selected2link function was not calling replaceSelection when no text was pre-selected, so no element received the setdatalink marker attribute
  • The OK button handler (linkRecord) searches for elements with that attribute and found nothing, causing the silent failure
  • Added the missing replaceSelection call in the else branch

Fixes #1431

When no text was selected before clicking Add Link in the jQuery TE
editor, the selected2link function's else branch did not call
replaceSelection to mark an element with the setdatalink attribute.
This caused linkRecord (triggered by the OK button) to find no marked
elements and silently do nothing. Now replaceSelection is called in
all cases so the link can be inserted even without a prior selection.

Fixes opendcim#1431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device Notes - OK button when entering a web address doesn't seem to work

1 participant