Skip to content

Commit

Permalink
if.bind & show.bind initial support (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
denofevil committed Aug 16, 2019
1 parent cf9394b commit 2d528f1
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ class AttributesProvider : XmlAttributeDescriptorsProvider {
override fun getAttributeDescriptors(xmlTag: XmlTag): Array<XmlAttributeDescriptor> = arrayOf(
AttributeDescriptor(Aurelia.REPEAT_FOR),
AttributeDescriptor(Aurelia.VIRTUAL_REPEAT_FOR),
AttributeDescriptor(Aurelia.AURELIA_APP)
AttributeDescriptor(Aurelia.AURELIA_APP),
AttributeDescriptor("if.bind"),
AttributeDescriptor("show.bind")
)

override fun getAttributeDescriptor(name: String, xmlTag: XmlTag): XmlAttributeDescriptor? {
for (attr in Aurelia.INJECTABLE) {
if (name.endsWith(".$attr")) {
val attrName = name.substring(0, name.length - attr.length - 1)
if ("if" == attrName || "show" == attrName) {
return AttributeDescriptor(name)
}
val descriptor = xmlTag.descriptor
if (descriptor != null) {
val attrName = name.substring(0, name.length - attr.length - 1)
val attributeDescriptor = descriptor.getAttributeDescriptor(attrName, xmlTag)
return attributeDescriptor ?: descriptor.getAttributeDescriptor("on$attrName", xmlTag)
}
Expand Down

0 comments on commit 2d528f1

Please sign in to comment.