From c53e776097a5fcbea65a0f7cf03713454659e194 Mon Sep 17 00:00:00 2001 From: Chris Greene Date: Sun, 26 Apr 2015 01:53:53 +1000 Subject: [PATCH] Update aloha-ui-links.js the href property is editable in firefox if the link text is selected, however when a link is clicked using aloha-ui-links.js the text is not highlighted. i modifed the open function in aloha.ui-links.js --- demo/aloha-ui/js/aloha-ui-links.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/demo/aloha-ui/js/aloha-ui-links.js b/demo/aloha-ui/js/aloha-ui-links.js index 89873adcd4..ebbb2d45ae 100644 --- a/demo/aloha-ui/js/aloha-ui-links.js +++ b/demo/aloha-ui/js/aloha-ui-links.js @@ -63,6 +63,14 @@ query('a.aloha-link-follow', doc, Dom.setAttr, 'href', href); query('.aloha-action-target', doc, Dom.toggleClass, 'active', '_blank' === target); Dom.addClass(anchor, 'aloha-active'); + + // href property is editable in firefox if the link text is selected + var range = document.createRange(); + range.selectNodeContents(anchor); + var sel = window.getSelection(); + sel.removeAllRanges(); + sel.addRange(range); + Dom.addClass(toolbar, 'active'); positionToolbar(toolbar, anchor); toolbar.querySelector('input').value = href;