Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for DFL-3728, Opening link ot CSS file at Documents tab doesn't scro... #137

Merged
merged 2 commits into from

2 participants

@p01
Owner

...ll it to relevant line in Resources tab

@p01
Owner

This regression was introduced by adding the scroll class in 565ce9f :\

Anyways, this selector makes more sense as it only matches text resources.

Owner

Other than that LGTM.

@chriskr

Should there not be a .join() at the end to make it more explicit what this is?

@p01 p01 merged commit 46a22a8 into task_DFL_2491_Resource_Inspector_Improvements_reviewed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 21, 2012
  1. @p01

    Fix for DFL-3728, Opening link ot CSS file at Documents tab doesn't s…

    p01 authored
    …croll it to relevant line in Resources tab
  2. @p01

    Explicit .join(",")

    p01 authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/resource-manager/resource_detail_view.js
View
14 src/resource-manager/resource_detail_view.js
@@ -25,8 +25,10 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
container.clearAndRender(window.templates.disabled_view());
};
+ this.TEXT_RESOURCE_DETAIL_CONTAINER_SELECTOR = ["markup", "css", "script", "text"].map(function(v) {
+ return ".resource-detail-" + v + "-container";
+ }).join(",");
var HIGHLIGHTED_LINE_CLASSNAME = "highlighted-line";
- var RESOURCE_DETAIL_CONTAINER_CLASSNAME = "resource-detail-container";
var TEXT = document.TEXT_NODE;
var ELE = document.ELEMENT_NODE;
var HIGHLIGHT_CONTEXT_SIZE = 8;
@@ -117,7 +119,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
if (!data || data.line == null)
return;
- this._root_ele = container.querySelector("." + RESOURCE_DETAIL_CONTAINER_CLASSNAME);
+ this._root_ele = container.querySelector(this.TEXT_RESOURCE_DETAIL_CONTAINER_SELECTOR);
if (this._root_ele)
{
this.clear_line_highlight(this._root_ele);
@@ -226,9 +228,6 @@ cls.ResourceDetailView.create_ui_widgets = function()
});
var text_search = window.views.resource_detail_view.text_search = new TextSearch();
- var TEXT_RESOURCE_DETAIL_CONTAINER_CLASSNAMES = ["markup", "css", "script", "text"].map(function(v) {
- return ".resource-detail-" + v + "-container";
- });
window.event_handlers.input["resource-text-search"] = function(event, target)
{
@@ -244,13 +243,14 @@ cls.ResourceDetailView.create_ui_widgets = function()
{
if (msg.id === "resource_detail_view")
{
- var scroll_container = msg.container.querySelector(TEXT_RESOURCE_DETAIL_CONTAINER_CLASSNAMES);
+ var view = window.views.resource_detail_view;
+ var scroll_container = msg.container.querySelector(view.TEXT_RESOURCE_DETAIL_CONTAINER_SELECTOR);
if (scroll_container)
{
text_search.setContainer(scroll_container);
text_search.setFormInput(
- views.resource_detail_view.getToolbarControl(msg.container, "resource-text-search")
+ view.getToolbarControl(msg.container, "resource-text-search")
);
}
}
Something went wrong with that request. Please try again.