-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
105 additions
and
204 deletions.
There are no files selected for viewing
22 changes: 0 additions & 22 deletions
22
common.blocks/textarea/__control/textarea__control.bemhtml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
block('textarea')( | ||
js()(true), | ||
def()(function() { | ||
applyNext({ _textarea : this.ctx }); | ||
tag()('textarea'), | ||
|
||
// NOTE: mix below is to satisfy interface of `control` | ||
mix()({ elem : 'control' }), | ||
|
||
attrs()(function() { | ||
var ctx = this.ctx, | ||
attrs = { | ||
id : ctx.id, | ||
name : ctx.name, | ||
tabindex : ctx.tabIndex, | ||
placeholder : ctx.placeholder | ||
}; | ||
|
||
ctx.autocomplete === false && (attrs.autocomplete = 'off'); | ||
ctx.mods.disabled && (attrs.disabled = 'disabled'); | ||
|
||
return attrs; | ||
}), | ||
content()({ elem : 'control' }) | ||
content()(function() { | ||
return this.ctx.val; | ||
}) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
module.exports = function(bh) { | ||
|
||
bh.match('textarea', function(ctx, json) { | ||
var attrs = { | ||
id : json.id, | ||
name : json.name, | ||
tabindex : json.tabIndex, | ||
placeholder : json.placeholder | ||
}; | ||
|
||
json.autocomplete === false && (attrs.autocomplete = 'off'); | ||
|
||
if(json.mods && json.mods.disabled) { | ||
attrs.disabled = 'disabled'; | ||
} | ||
|
||
ctx | ||
.js(true) | ||
.tParam('_textarea', json) | ||
.content({ elem : 'control' }, true); | ||
.tag('textarea') | ||
.attrs(attrs) | ||
.mix({ elem : 'control' }) // NOTE: satisfy interface of `control` | ||
.content(json.val, true); | ||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div class="textarea i-bem" data-bem="{"textarea":{}}"><textarea class="textarea__control"></textarea></div> | ||
<textarea class="textarea textarea__control i-bem" data-bem="{"textarea":{}}"></textarea> |
2 changes: 1 addition & 1 deletion
2
common.blocks/textarea/textarea.tmpl-specs/20-default_disabled.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div class="textarea textarea_disabled i-bem" data-bem="{"textarea":{}}"><textarea class="textarea__control" disabled="disabled"></textarea></div> | ||
<textarea class="textarea textarea__control textarea_disabled i-bem" disabled="disabled" data-bem="{"textarea":{}}"></textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div class="textarea i-bem" data-bem="{"textarea":{}}"><textarea class="textarea__control" id="1" name="textarea1" tabindex="1" placeholder="hint" autocomplete="off">textarea</textarea></div> | ||
<textarea class="textarea textarea__control i-bem" id="1" name="textarea1" tabindex="1" placeholder="hint" autocomplete="off" data-bem="{"textarea":{}}">textarea</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<div class="textarea i-bem" data-bem="{"textarea":{}}"><textarea class="textarea__control">textarea</textarea></div> | ||
<textarea class="textarea textarea__control i-bem" data-bem="{"textarea":{}}">textarea</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 12 additions & 33 deletions
45
design/common.blocks/textarea/_theme/textarea_theme_simple.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.