From 3053b18ff3c6a741558a178886646fd31f202118 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Wed, 24 Sep 2014 16:46:32 +0200 Subject: [PATCH 1/2] Fix wrongly enabled hyperlink tools with no document loaded --- ChangeLog.md | 14 ++++++++++++++ programs/editor/widgets/editHyperlinks.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 0b3acff61..a046a6978 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,17 @@ +# Changes between 0.5.4 and 0.5.5 + +## WebODF + + + +## Wodo.TextEditor +See also section about WebODF + +### Fixes + +* Fix wrongly enabled hyperlink tools with no document loaded ([#833](https://github.com/kogmbh/WebODF/pull/833)) + + # Changes between 0.5.3 and 0.5.4 ## WebODF diff --git a/programs/editor/widgets/editHyperlinks.js b/programs/editor/widgets/editHyperlinks.js index fb49db28c..6ca61a521 100644 --- a/programs/editor/widgets/editHyperlinks.js +++ b/programs/editor/widgets/editHyperlinks.js @@ -88,7 +88,7 @@ define("webodf/editor/widgets/editHyperlinks", [ // Enable to disable all widgets initially widget.children.forEach(function (element) { - element.set('disabled', controllerEnabled === false, false); + element.set('disabled', controllerEnabled !== true, false); }); if (controllerEnabled) { // Specifically enable the remove hyperlink button only if there are links in the current selection From a68442d4e6bacab7fa6aaaf2f8f4a02d3adfa08e Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Wed, 24 Sep 2014 17:12:37 +0200 Subject: [PATCH 2/2] Remove duplicated code, linksInSelection is set later again --- programs/editor/widgets/editHyperlinks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/editor/widgets/editHyperlinks.js b/programs/editor/widgets/editHyperlinks.js index 6ca61a521..40176a97b 100644 --- a/programs/editor/widgets/editHyperlinks.js +++ b/programs/editor/widgets/editHyperlinks.js @@ -84,7 +84,7 @@ define("webodf/editor/widgets/editHyperlinks", [ function updateHyperlinkButtons() { var controllerEnabled = hyperlinkController && hyperlinkController.isEnabled(), - linksInSelection = controllerEnabled && editorSession.getSelectedHyperlinks(); + linksInSelection; // Enable to disable all widgets initially widget.children.forEach(function (element) {