Skip to content

Commit

Permalink
input: Cut off the label
Browse files Browse the repository at this point in the history
  • Loading branch information
persidskiy committed Jun 25, 2014
1 parent 564c803 commit c4ab364
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 74 deletions.
4 changes: 0 additions & 4 deletions common.blocks/input/__label/input__label.bemhtml

This file was deleted.

6 changes: 0 additions & 6 deletions common.blocks/input/__label/input__label.bh.js

This file was deleted.

1 change: 0 additions & 1 deletion common.blocks/input/__label/input__label.en.title.txt

This file was deleted.

1 change: 0 additions & 1 deletion common.blocks/input/__label/input__label.ru.title.txt

This file was deleted.

28 changes: 0 additions & 28 deletions common.blocks/input/input.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,6 @@ The block is available in `simple` and `normal` themes.

---

### `_has-label`

A lable (`__label` element) above the input field is available if a block has a `_has-label` modifier with `true` value.

The block is available in `simple` and `normal` themes.

<table>
Expand All @@ -324,7 +320,6 @@ The block is available in `simple` and `normal` themes.
{
block : 'input',
mods : { 'has-clear' : true },
label : 'Label',
placeholder : 'default'
}
</code></pre>
Expand All @@ -335,9 +330,7 @@ The block is available in `simple` and `normal` themes.
block : 'input',
mods : {
theme : 'simple',
'has-label' : true
},
label : 'Label',
placeholder : 'simple'
}
</code></pre>
Expand All @@ -348,9 +341,7 @@ The block is available in `simple` and `normal` themes.
block : 'input',
mods : {
theme : 'normal',
'has-label' : true
},
label : 'Label',
placeholder : 'normal'
}
</code></pre>
Expand All @@ -376,7 +367,6 @@ The cross element is unavailable if a block has a `has-clear` modifier with `fal
{
block : 'input',
mods : { theme : 'normal', 'has-clear' : true },
label : 'label'
}
```

Expand All @@ -386,24 +376,6 @@ A mandatory element.

This element is processed by BEMHTML or BH template engine to native `<input>` or `<textarea>` control.

### __label

This element provides a label for an input field. In HTML is rendered as a `<label>` tag. The label is linked with an `<input>` tag by the unique `id` identifier.

Input gets focus when label is clicked.

```bemjson
[{
block: 'input', elem: 'label',
id: 'my-input',
content: 'Label for input'
},
{
block : 'input',
id: 'my-input',
mods : { theme : 'normal', size : 'm'},
}]
```

## Block's dependencies

Expand Down
20 changes: 1 addition & 19 deletions common.blocks/input/input.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@

Кнопка очистки содержимого инпута («крестик»).

По умолчанию модификатор `_has-label` имеет значение `_false`, при котором крестик не отображается. Для отображения крестика нужно установить модификатор в значение `_true`.
По умолчанию модификатор `_has-clear` имеет значение `false`, при котором крестик не отображается. Для отображения крестика нужно установить модификатор в значение `true`.

```bemjson
{
Expand All @@ -282,24 +282,6 @@

BEMHTML- или BH-шаблоном преобразуется в нативный контрол `<input>` или `<textarea>`.

### __label

Элемент добавляет метку с тегом `<label>` для поля ввода. Связь метки с тэгом `<input>` устанавливается с помощью идентификатора `id`.
При щелчке кнопкой мыши на метку в поле ввода будет установлен фокус.

```bemjson
[{
block: 'input', elem: 'label',
id: 'my-input',
content: 'Метка для поля ввода'
},
{
block : 'input',
id: 'my-input',
mods : { theme : 'normal', size : 'm'},
}]
```

## Зависимости блока

* `base-control`
Expand Down
16 changes: 1 addition & 15 deletions common.blocks/input/input.tests/simple.bemjson.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
placeholder : 'placeholder',
mods : { disabled : true }
} },
{ tag : 'p', content : {
block : 'input',
mods : { 'has-clear' : true, 'has-label' : true },
val : 'value',
label : 'label',
placeholder : 'placeholder'
} },
{ tag : 'p', content : {
block : 'input',
mods : { type : 'search' },
Expand Down Expand Up @@ -56,13 +49,6 @@
val : 'disabled',
placeholder : 'placeholder'
} },
{ tag : 'p', content : {
block : 'input',
mods : { theme : 'simple', 'has-clear' : true, 'has-label' : true },
val : 'value',
label : 'label',
placeholder : 'placeholder'
} },
{ tag : 'p', content : {
block : 'input',
mods : { theme : 'simple', 'has-clear' : true, type : 'search' },
Expand Down Expand Up @@ -120,7 +106,7 @@

{ tag : 'h3', content : 'label' },
{ tag : 'p', content : [
{ block : 'input', elem : 'label', id : 'with-label', content : 'label' },
{ tag : 'label', attrs : { 'for' : 'with-label' }, content : 'label' },
': ',
{
block : 'input',
Expand Down

0 comments on commit c4ab364

Please sign in to comment.