Index: Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
diff --git a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
index f2331b8913c89994b9ae2f855f63f3babf659da0..56ccaf43fbd36d8955c4d09d2488f859f4447f01 100644 |
--- a/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
+++ b/Source/devtools/front_end/sources/JavaScriptSourceFrame.js |
@@ -280,16 +280,29 @@ WebInspector.JavaScriptSourceFrame.prototype = { |
// FIXME: Change condition above to explicitly check that current uiSourceCode is created by default debugger mapping |
// and move the code adding this menu item to generic context menu provider for UISourceCode. |
var liveEditLabel = WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Live edit" : "Live Edit"); |
- contextMenu.appendItem(liveEditLabel, liveEdit.bind(this)); |
+ var targetId = WebInspector.DefaultScriptMapping.targetIdFromProjectId(this._uiSourceCode.project().id()); |
vsevik
2014/06/26 13:07:29
Let's make projectIdForTargetId public static inst
sergeyv
2014/06/26 14:08:40
Done.
|
+ var target; |
+ var targets = WebInspector.targetManager.targets(); |
+ for (var i = 0; i < targets.length; ++i) { |
+ if (targetId === targets[i].id()) { |
+ target = targets[i]; |
+ break; |
+ } |
+ } |
+ if (!target) |
+ return; |
+ |
+ contextMenu.appendItem(liveEditLabel, liveEdit.bind(this, target.liveEditSupport)); |
contextMenu.appendSeparator(); |
} |
/** |
* @this {WebInspector.JavaScriptSourceFrame} |
+ * @param {!WebInspector.LiveEditSupport} liveEditSupport |
*/ |
- function liveEdit() |
+ function liveEdit(liveEditSupport) |
{ |
- var liveEditUISourceCode = WebInspector.liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode); |
+ var liveEditUISourceCode = liveEditSupport.uiSourceCodeForLiveEdit(this._uiSourceCode); |
WebInspector.Revealer.reveal(liveEditUISourceCode.uiLocation(lineNumber)); |
} |