Skip to content

Commit

Permalink
Merge b3156f9 into ef407fb
Browse files Browse the repository at this point in the history
  • Loading branch information
Gela committed Jul 25, 2018
2 parents ef407fb + b3156f9 commit cfe3e5e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions common.blocks/attach/__control/attach__control.bemhtml.js
Expand Up @@ -11,6 +11,7 @@ block('attach').elem('control')(
attrs.name = attach.name;
attach.mods && attach.mods.disabled && (attrs.disabled = 'disabled');
attach.tabIndex && (attrs.tabindex = attach.tabIndex);
attach.accept && (attrs.accept = attach.accept);
}

return attrs;
Expand Down
1 change: 1 addition & 0 deletions common.blocks/attach/__control/attach__control.bh.js
Expand Up @@ -9,6 +9,7 @@ module.exports = function(bh) {
attrs.name = attach.name;
attach.mods && attach.mods.disabled && (attrs.disabled = 'disabled');
attach.tabIndex && (attrs.tabindex = attach.tabIndex);
attach.accept && (attrs.accept = attach.accept);
}

ctx
Expand Down
2 changes: 2 additions & 0 deletions common.blocks/attach/attach.js
Expand Up @@ -34,6 +34,7 @@ provide(bemDom.declBlock(this.name, Control, /** @lends attach.prototype */{
_clear : function(data) {
var control = this._elem('control').domElem,
name = control.attr('name'),
accept = control.attr('accept'),
tabIndex = control.attr('tabindex');

bemDom.replace(
Expand All @@ -42,6 +43,7 @@ provide(bemDom.declBlock(this.name, Control, /** @lends attach.prototype */{
' class="' + control.attr('class') + '"' +
' type="file"' +
(name? ' name="' + name + '"' : '') +
(accept? ' accept="' + accept + '"' : '') +
(tabIndex? ' tabindex="' + tabIndex + '"' : '') +
'/>');

Expand Down
Expand Up @@ -4,5 +4,6 @@
name : 'attach-name',
button : { block : 'button', mods : { theme : 'islands', size : 'm' } },
noFileText : 'no file',
accept : 'image/*',
tabIndex : 1
})
2 changes: 1 addition & 1 deletion common.blocks/attach/attach.tmpl-specs/10-simple.html
@@ -1,6 +1,6 @@
<span class="attach attach_theme_simple attach_size_l i-bem" data-bem="{&quot;attach&quot;:{}}">
<span class="button button_theme_islands button_size_m button__control i-bem" data-bem="{&quot;button&quot;:{}}" role="button">
<input class="attach__control" type="file" name="attach-name" tabindex="1">
<input class="attach__control" type="file" name="attach-name" accept="image/*" tabindex="1">
</span>
<span class="attach__no-file">no file</span>
</span>

0 comments on commit cfe3e5e

Please sign in to comment.