summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/StylesSidebarPane.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/StylesSidebarPane.js')
-rw-r--r--WebCore/inspector/front-end/StylesSidebarPane.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 1dddde7..6aff37d 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -64,6 +64,7 @@ WebInspector.StylesSidebarPane = function(computedStylePane)
this.titleElement.appendChild(this.settingsSelectElement);
this._computedStylePane = computedStylePane;
+ this.element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
}
// Taken from http://www.w3.org/TR/CSS21/propidx.html.
@@ -105,6 +106,17 @@ WebInspector.StylesSidebarPane.prototype = {
this.settingsSelectElement[2].selected = true;
},
+ _contextMenuEventFired: function(event)
+ {
+ var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
+ if (href) {
+ var contextMenu = new WebInspector.ContextMenu();
+ var filled = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);
+ if (filled)
+ contextMenu.show(event);
+ }
+ },
+
update: function(node, editedSection, forceUpdate)
{
var refresh = false;