From 706ee78c44ed48f926e0c877054164480145c0a3 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 29 Oct 2013 11:49:21 -0700 Subject: [PATCH 1/3] Check filename header clicks in the right context. --- src/editor/MultiRangeInlineEditor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/MultiRangeInlineEditor.js b/src/editor/MultiRangeInlineEditor.js index 8da417437ab..6164bcacc13 100644 --- a/src/editor/MultiRangeInlineEditor.js +++ b/src/editor/MultiRangeInlineEditor.js @@ -506,7 +506,8 @@ define(function (require, exports, module) { } // Ignore clicks in editor and clicks on filename link - if (!containsClick($(editorRoot)) && !containsClick($(".filename", this.$editorHolder))) { + // Check clicks on filename link in the context of the parent node of $editorHolder. + if (!containsClick($(editorRoot)) && !containsClick($(".filename", this.$editorHolder.parent()))) { childEditor.focus(); // Only set the cursor if the click isn't in the range list. if (!containsClick(this.$relatedContainer)) { From bd7a646a5c6dd231e3924c991e606b20a518915c Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 29 Oct 2013 12:34:05 -0700 Subject: [PATCH 2/3] Switch to a better context this.$htmlContent. --- src/editor/MultiRangeInlineEditor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/editor/MultiRangeInlineEditor.js b/src/editor/MultiRangeInlineEditor.js index 6164bcacc13..ca492192b90 100644 --- a/src/editor/MultiRangeInlineEditor.js +++ b/src/editor/MultiRangeInlineEditor.js @@ -506,8 +506,7 @@ define(function (require, exports, module) { } // Ignore clicks in editor and clicks on filename link - // Check clicks on filename link in the context of the parent node of $editorHolder. - if (!containsClick($(editorRoot)) && !containsClick($(".filename", this.$editorHolder.parent()))) { + if (!containsClick($(editorRoot)) && !containsClick($(".filename", this.$htmlContent))) { childEditor.focus(); // Only set the cursor if the click isn't in the range list. if (!containsClick(this.$relatedContainer)) { From 3b3e02ad80de3259daf6e4b49902ea788cc2dab9 Mon Sep 17 00:00:00 2001 From: RaymondLim Date: Tue, 29 Oct 2013 12:50:24 -0700 Subject: [PATCH 3/3] Adding back the comment. --- src/editor/MultiRangeInlineEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editor/MultiRangeInlineEditor.js b/src/editor/MultiRangeInlineEditor.js index ca492192b90..47a80d2c436 100644 --- a/src/editor/MultiRangeInlineEditor.js +++ b/src/editor/MultiRangeInlineEditor.js @@ -506,6 +506,7 @@ define(function (require, exports, module) { } // Ignore clicks in editor and clicks on filename link + // Check clicks on filename link in the context of the current inline widget. if (!containsClick($(editorRoot)) && !containsClick($(".filename", this.$htmlContent))) { childEditor.focus(); // Only set the cursor if the click isn't in the range list.