Enable editing a link by clicking on it.

* src/client/composer/composer-widget.vala
  (ComposerWidget::on_button_press): Show a link popover on button
  release.

* src/client/composer/composer-web-view.vala (ComposerWebView): Add
  button_release_event_done signal to work around WK eating mouse events,
  fire it after default processing has occurred.

* ui/composer-web-view.js: Don't bother selecting a link on click, we
  are handling insertion and deletion without it fine now. Just cancel
  the event's default so link clicks are not activated.
This commit is contained in:
Michael James Gratton 2017-01-19 13:16:13 +11:00
parent e4f50e1c36
commit ab4fec91be
3 changed files with 37 additions and 4 deletions

View file

@ -33,7 +33,7 @@ ComposerPageState.prototype = {
document.addEventListener("click", function(e) {
if (e.target.tagName == "A") {
state.linkClicked(e.target);
e.preventDefault();
}
}, true);
@ -204,9 +204,6 @@ ComposerPageState.prototype = {
documentModified: function(element) {
window.webkit.messageHandlers.documentModified.postMessage(null);
},
linkClicked: function(element) {
window.getSelection().selectAllChildren(element);
},
selectionChanged: function() {
PageState.prototype.selectionChanged.apply(this, []);