Skip to content

Commit 719926a

Browse files
committed
Changed to use normalize css in the scope of control
Changed to use normalize css in the scope of control
1 parent f0ac858 commit 719926a

25 files changed

+293
-134
lines changed

src/InputControl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ define(
159159
name: 'readOnly',
160160
paint: function (control, value) {
161161
var method = value ? 'addState' : 'removeState';
162-
control[method]('readOnly');
162+
control[method]('read-only');
163163
var nodeName = control.main.nodeName.toLowerCase();
164164
if (nodeName === 'input'
165165
|| nodeName === 'select'
@@ -221,7 +221,7 @@ define(
221221
*/
222222
setReadOnly: function (readOnly) {
223223
readOnly = !!readOnly;
224-
this[readOnly ? 'addState' : 'removeState']('readOnly');
224+
this[readOnly ? 'addState' : 'removeState']('read-only');
225225
},
226226

227227
/**
@@ -230,7 +230,7 @@ define(
230230
* @return {boolean}
231231
*/
232232
isReadOnly: function () {
233-
return this.hasState('readOnly');
233+
return this.hasState('read-only');
234234
},
235235

236236
/**

src/TextLine.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ define(
1111
require('./TextBox');
1212
require('./Panel');
1313

14-
// 仅在调试的时候打开
15-
//require('css!./css/TextLine.css');
16-
1714
var lib = require('./lib');
1815
var helper = require('./controlHelper');
1916
var InputControl = require('./InputControl');
@@ -256,7 +253,7 @@ define(
256253
// 输入区
257254
var textArea = textLine.getChild('text');
258255
if (value) {
259-
if (typeof value === 'array') {
256+
if (lib.isArray(value)) {
260257
textLine.value =
261258
lib.decodeHTML(value.join('\n'));
262259
}

src/Tip.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ define(
1414
var ui = require('./main');
1515
var paint = require('./painters');
1616

17-
// css
18-
require('css!./css/Tip.css');
19-
2017
/**
2118
* 提示控件类
2219
*
@@ -144,7 +141,7 @@ define(
144141
helper.layer.attachTo(
145142
layer,
146143
tip.main,
147-
{ top: 'bottom', left: 'left'}
144+
{ top: 'bottom', left: 'left', spaceDetection: 'both'}
148145
);
149146

150147
tip.repaint();

src/controlHelper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ define(
116116
*/
117117
helper.getPartClasses = function (control, part) {
118118
// main:
119+
// ui-ctrl 为了定义有限全局的normalize
119120
// ui-{type}
120121
// skin-{skinname}
121122
// skin-{skinname}-{type}
@@ -128,14 +129,15 @@ define(
128129
var prefix = ui.getConfig('uiClassPrefix');
129130
var skinPrefix = ui.getConfig('skinClassPrefix');
130131
var classes = [];
131-
132+
132133
if (part) {
133134
classes.push(joinByStrike(prefix, type, part));
134135
if (skin) {
135136
classes.push(joinByStrike(skinPrefix, skin, type, part));
136137
}
137138
}
138139
else {
140+
classes.push('ui-ctrl');
139141
classes.push(joinByStrike(prefix, type));
140142
if (skin) {
141143
classes.push(
@@ -602,7 +604,7 @@ define(
602604
if (main.readOnly
603605
&& (options.readOnly === null
604606
|| options.readOnly === undefined)) {
605-
options.readOnly = main.readonly;
607+
options.readOnly = main.readonly || main.readOnly;
606608
}
607609
}
608610
};

src/css/Box.less

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
@import "mixin.less";
1010
@import "variable.less";
11-
@import "common.less";
12-
1311

1412
.ui-checkbox,
1513
.ui-radio,
@@ -32,4 +30,4 @@
3230
.ui-boxgroup-wrapper {
3331
.inline-block ();
3432
}
35-
}
33+
}

src/css/Calendar.less

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/**
2+
* ESUI (Enterprise Simple UI)
3+
* Copyright 2013 Baidu Inc. All rights reserved.
4+
*
5+
* @file 输入日历样式
6+
* @author dbear
7+
*/
18
@import "mixin.less";
29
@import "variable.less";
3-
@import "common.less";
410
.ui-calendar {
511
border: 1px solid #a9adb6;/*border:1px solid #dde0e9;*/
612
width: 110px;
@@ -41,4 +47,11 @@
4147
}
4248
.ui-calendar-layer-hidden {
4349
display: none;
44-
}
50+
}
51+
52+
.ui-calendar-disabled,
53+
.ui-calendar-read-only {
54+
color: #999;
55+
border-color: #D8D8D8;
56+
}
57+

src/css/CommandMenu.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/**
2+
* ESUI (Enterprise Simple UI)
3+
* Copyright 2013 Baidu Inc. All rights reserved.
4+
*
5+
* @file 对话框样式
6+
* @author dbear
7+
*/
18
@import "mixin.less";
29
@import "variable.less";
3-
410
.ui-commandmenu {
511
.linear-gradient-background-with-image (
612
top, #ffffff, #f6f6f6, "esui-combo-arrow.png", right, -6px, #f3f3f3);
@@ -76,4 +82,4 @@
7682

7783
.ui-commandmenu-layer-hidden {
7884
display: none;
79-
}
85+
}

src/css/Crumb.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
@import "mixin.less";
99
@import "variable.less";
10-
@import "common.less";
10+
1111
.ui-crumb {
1212
ol {
1313
padding: 0;

src/css/MonthView.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
/**
2+
* ESUI (Enterprise Simple UI)
3+
* Copyright 2013 Baidu Inc. All rights reserved.
4+
*
5+
* @file 单日历样式
6+
* @author dbear
7+
*/
18
@import "mixin.less";
29
@import "variable.less";
3-
@import "common.less";
410
.ui-monthview {
511
background:#fff;
612
width:210px;
@@ -89,4 +95,4 @@
8995
background-position: -20px -200px;
9096
}
9197
}
92-
}
98+
}

src/css/Pager.less

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
@import "common.less";
1+
/**
2+
* ESUI (Enterprise Simple UI)
3+
* Copyright 2013 Baidu Inc. All rights reserved.
4+
*
5+
* @file 翻页样式
6+
* @author shenbin
7+
*/
8+
@import "mixin.less";
9+
@import "variable.less";
10+
211
/** Pager 文字配色 */
312
@pager-text-color: #333;
413

0 commit comments

Comments
 (0)