Skip to content

Commit

Permalink
component: improve inheritance deduction
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Feb 8, 2014
1 parent 24ec395 commit 918c84f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions opal/lissio/component.rb
Expand Up @@ -62,15 +62,17 @@ def self.inheritance
next unless klass.ancestors.include?(Component)
next unless klass.css

if klass.superclass != Component
next if klass.element != klass.superclass.element
next if klass.tag && !klass.superclass.tag

if a = klass.tag && b = klass.superclass.tag
next if a[:class] != b[:class] || a[:id] != b[:id]
end
tag = klass.tag
element = klass.element
parent = klass.superclass

if parent != Component
next if element != parent.element
next if tag && !parent.tag
next if tag && (tag[:class] != parent.tag[:class] || tag[:id] != parent.tag[:id])
else
next if klass.tag || klass.element
next if element
next if tag && (tag[:class] || tag[:id])
end

if klass.name
Expand Down

0 comments on commit 918c84f

Please sign in to comment.