fix file-browser

R=eseidel@chromium.org, abarth
BUG=

Review URL: https://codereview.chromium.org/705683002
This commit is contained in:
Rafael Weinstein 2014-11-04 15:21:57 -08:00
parent 17f3f02c77
commit b492557ddf
2 changed files with 13 additions and 6 deletions

View File

@ -13,11 +13,11 @@
}
</style>
<heading>File browser for {{ url }}</heading>
<template repeat="{{ directory in directories }}">
<a href="{{ directory }}">{{ directory }}</a>
<template repeat="{{ directories }}">
<a href="{{}}">{{}}</a>
</template>
<template repeat="{{ file in files }}">
<a href="{{ file }}">{{ file }}</a>
<template repeat="{{ files }}">
<a href="{{}}">{{}}</a>
</template>
</template>
<script>

View File

@ -57,8 +57,15 @@ function attributeBinding(el, name) {
};
}
function bindAsAttribute(el, name) {
if (name == 'style' || name == 'class')
return true;
if (el.tagName == 'a' && name == 'href')
return true;
}
Element.prototype.bind = function(name, value, oneTime) {
if (name !== 'style' && name !== 'class')
if (!bindAsAttribute(this, name))
return Node.prototype.bind.call(this, name, value, oneTime);
if (oneTime)
@ -121,7 +128,7 @@ var templateAttributeDirectives = {
function isTemplate(el) {
if (el.isTemplate_ === undefined)
el.isTemplate_ = el.tagName == 'TEMPLATE';
el.isTemplate_ = el.tagName == 'template';
return el.isTemplate_;
}