Skip to content

Commit

Permalink
Rename base-control to control (close #656)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Varankin committed Jun 29, 2014
1 parent a0eecc5 commit 8ab035c
Show file tree
Hide file tree
Showing 38 changed files with 238 additions and 242 deletions.
2 changes: 1 addition & 1 deletion common.blocks/attach/attach.deps.js
@@ -1,7 +1,7 @@
[{
mustDeps : { block : 'i-bem', elems : ['dom', 'i18n'] },
shouldDeps : [
{ block : 'base-control' },
{ block : 'control' },
{ block : 'button' },
{ block : 'icon' },
{ elems : ['button', 'control', 'no-file', 'file'] },
Expand Down
8 changes: 4 additions & 4 deletions common.blocks/attach/attach.js
Expand Up @@ -4,16 +4,16 @@

modules.define(
'attach',
['i-bem__dom', 'base-control', 'jquery', 'BEMHTML', 'strings__escape'],
function(provide, BEMDOM, BaseControl, $, BEMHTML, escape) {
['i-bem__dom', 'control', 'jquery', 'BEMHTML', 'strings__escape'],
function(provide, BEMDOM, Control, $, BEMHTML, escape) {

/**
* @exports
* @class attach
* @augments base-control
* @augments control
* @bem
*/
provide(BEMDOM.decl({ block : this.name, baseBlock : BaseControl }, /** @lends attach.prototype */{
provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, /** @lends attach.prototype */{
onSetMod : {
'disabled' : function(modName, modVal) {
this.__base.apply(this, arguments);
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/attach/attach.ru.md
Expand Up @@ -113,7 +113,7 @@

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

* `base-control`
* `control`
* `i-bem__dom`
* `icon`
* `button`
124 changes: 0 additions & 124 deletions common.blocks/base-control/base-control.spec.js

This file was deleted.

2 changes: 1 addition & 1 deletion common.blocks/button/button.bemhtml
Expand Up @@ -10,7 +10,7 @@ block('button')(

js()(true),

// Implements `base-control`'s interface
// NOTE: mix below is to satisfy interface of `control`
mix()([{ elem : 'control' }]),

attrs()(
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.bh.js
Expand Up @@ -7,7 +7,7 @@ module.exports = function(bh) {

ctx
.attr('role', 'button') // Common attributes)
.mix({ elem : 'control' }); // Implements `base-control`'s interface
.mix({ elem : 'control' }); // NOTE: satisfy interface of `control`

json.tabIndex && ctx.attr('tabindex', json.tabIndex);
json.id && ctx.attr('id', json.id);
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.deps.js
Expand Up @@ -9,7 +9,7 @@
{ block : 'keyboard', elem : 'codes' },
'functions',
'events',
'base-control'
'control'
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.en.md
Expand Up @@ -570,5 +570,5 @@ This element intended to set a text position in the button.

The `button` block depends on

* `base-control`, that provides public API for the controls.`i-bem__dom`
* `control`, that provides public API for the controls
* `i-bem__dom`
8 changes: 4 additions & 4 deletions common.blocks/button/button.js
Expand Up @@ -4,16 +4,16 @@

modules.define(
'button',
['i-bem__dom', 'base-control', 'jquery', 'dom', 'functions', 'keyboard__codes'],
function(provide, BEMDOM, BaseControl, $, dom, functions, keyCodes) {
['i-bem__dom', 'control', 'jquery', 'dom', 'functions', 'keyboard__codes'],
function(provide, BEMDOM, Control, $, dom, functions, keyCodes) {

/**
* @exports
* @class button
* @augments base-control
* @augments control
* @bem
*/
provide(BEMDOM.decl({ block : this.name, baseBlock : BaseControl }, /** @lends button.prototype */{
provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, /** @lends button.prototype */{
beforeSetMod : {
'pressed' : {
'true' : function() {
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/button/button.ru.md
Expand Up @@ -298,6 +298,6 @@

## Зависимости

* `base-control`
* `control`
* `i-bem__dom`
* `keyboard`
2 changes: 1 addition & 1 deletion common.blocks/checkbox/checkbox.deps.js
Expand Up @@ -6,7 +6,7 @@
mods : { disabled : true, focused : true, checked : true }
},
{ block : 'jquery', elem : 'event', mods : { type : 'pointer' } },
'base-control'
'control'
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/checkbox/checkbox.en.md
Expand Up @@ -309,5 +309,5 @@ The `control` element is added to the block on a template engine level.
## Block's dependencies

* `i-bem__dom`
* `base-control`
* `control`
* `button`
6 changes: 3 additions & 3 deletions common.blocks/checkbox/checkbox.js
Expand Up @@ -2,15 +2,15 @@
* @module checkbox
*/

modules.define('checkbox', ['i-bem__dom', 'base-control'], function(provide, BEMDOM, BaseControl) {
modules.define('checkbox', ['i-bem__dom', 'control'], function(provide, BEMDOM, Control) {

/**
* @exports
* @class checkbox
* @augments base-control
* @augments control
* @bem
*/
provide(BEMDOM.decl({ block : this.name, baseBlock : BaseControl }, /** @lends checkbox.prototype */{
provide(BEMDOM.decl({ block : this.name, baseBlock : Control }, /** @lends checkbox.prototype */{
onSetMod : {
'checked' : function(modName, modVal) {
this.elem('control').prop(modName, modVal);
Expand Down
2 changes: 1 addition & 1 deletion common.blocks/checkbox/checkbox.ru.md
Expand Up @@ -267,5 +267,5 @@
## Зависимости блока

* `i-bem__dom`
* `base-control`
* `control`
* `button`
File renamed without changes.
@@ -1,4 +1,4 @@
# base-control
# control

Auxiliary block designed to implement the common functionality of the most blocks of [bem-components](https://github.com/bem/bem-components) library to provide them `focused` and `disabled` states: [attach](https://github.com/bem/bem-components/blob/v2/common.blocks/attach/attach.en.md), [button](https://github.com/bem/bem-components/blob/v2/common.blocks/button/button.en.md), [checkbox](https://github.com/bem/bem-components/blob/v2/common.blocks/checkbox/checkbox.en.title.txt), [input], [link], [menu], [radio].

Expand Down
@@ -1,17 +1,17 @@
/** @module base-control */
/** @module control */

modules.define(
'base-control',
'control',
['i-bem__dom', 'dom', 'next-tick'],
function(provide, BEMDOM, dom, nextTick) {

/**
* @exports
* @class base-control
* @class control
* @abstract
* @bem
*/
provide(BEMDOM.decl(this.name, /** @lends base-control.prototype */{
provide(BEMDOM.decl(this.name, /** @lends control.prototype */{
beforeSetMod : {
'focused' : {
'true' : function() {
Expand Down Expand Up @@ -97,7 +97,7 @@ provide(BEMDOM.decl(this.name, /** @lends base-control.prototype */{
_blur : function() {
this.elem('control').blur();
}
}, /** @lends base-control */{
}, /** @lends control */{
live : function() {
this
.liveBindTo('control', 'focusin', this.prototype._onFocus)
Expand Down
@@ -1,4 +1,4 @@
# base-control
# control

Вспомогательный блок. Используется для работы большинства блоков библиотеки [bem-components](https://github.com/bem/bem-components):

Expand Down
File renamed without changes.

0 comments on commit 8ab035c

Please sign in to comment.