Show line number of tag in live css panel

This commit is contained in:
Kovid Goyal 2014-05-20 15:45:53 +05:30
parent c9e7fe2546
commit 1f480dd3b8
3 changed files with 2 additions and 2 deletions

Binary file not shown.

View File

@ -336,7 +336,7 @@ class PreviewIntegration
while target and target.ownerDocument
css = get_matched_css(target, is_ancestor, all_properties)
if css.length > 0
ans['nodes'].push({'name':target.tagName?.toLowerCase(), 'css':css, 'is_ancestor':is_ancestor})
ans['nodes'].push({'name':target.tagName?.toLowerCase(), 'css':css, 'is_ancestor':is_ancestor, 'sourceline':target.getAttribute('data-lnum')})
target = target.parentNode
is_ancestor = true
return JSON.stringify(ans)

View File

@ -227,7 +227,7 @@ class Box(QWidget):
w.deleteLater()
self.widgets = []
for node in data['nodes']:
node_name = node['name']
node_name = node['name'] + ' @%s' % node['sourceline']
if node['is_ancestor']:
title = _('Inherited from %s') % node_name
else: