diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 5369033f7..d3295662b 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -292,6 +292,9 @@ var CPViewFlags = { }, CPDOMDisplayServerSetStyleLeftTop(_DOMElement, NULL, _CGRectGetMinX(aFrame), _CGRectGetMinY(aFrame)); CPDOMDisplayServerSetStyleSize(_DOMElement, width, height); + if (typeof(appkit_tag_dom_elements) !== "undefined" && !!appkit_tag_dom_elements) + _DOMElement.setAttribute("data-cappuccino-view", [self className]); + _DOMImageParts = []; _DOMImageSizes = []; #endif diff --git a/Tools/capp/Resources/Templates/Application/index-debug.html b/Tools/capp/Resources/Templates/Application/index-debug.html index 871c9f72d..a2da7fe2d 100644 --- a/Tools/capp/Resources/Templates/Application/index-debug.html +++ b/Tools/capp/Resources/Templates/Application/index-debug.html @@ -52,6 +52,10 @@ // Uncomment to enable a specific logger: //CPLogRegister(CPLogConsole); //CPLogRegister(CPLogPopup); + + // Tag view DOM elements with a "data-cappuccino-view" attribute that contains + // the class name of the view that created them. Comment this or set to false to disable. + appkit_tag_dom_elements = true;