Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
927ef73a
T
three.js
项目概览
Ablesons
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
927ef73a
编写于
9月 03, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Editor: Using checkbox for boolean stuff.
As suggested by @sole.
上级
5dc4b735
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
31 addition
and
12 deletion
+31
-12
editor/js/UI.js
editor/js/UI.js
+28
-9
editor/js/ui/Sidebar.Properties.Material.js
editor/js/ui/Sidebar.Properties.Material.js
+2
-2
editor/js/ui/Sidebar.Properties.Object3D.js
editor/js/ui/Sidebar.Properties.Object3D.js
+1
-1
未找到文件。
editor/js/UI.js
浏览文件 @
927ef73a
...
...
@@ -344,30 +344,49 @@ UI.Select.prototype.onChange = function ( callback ) {
};
// Checkbox
// Boolean
UI
.
Checkbox
=
function
(
position
)
{
UI
.
Boolean
=
function
(
position
)
{
UI
.
Element
.
call
(
this
);
var
scope
=
this
;
this
.
dom
=
document
.
createElement
(
'
input
'
);
this
.
dom
.
type
=
'
checkbox
'
;
this
.
dom
.
style
.
position
=
position
||
'
relative
'
;
UI
.
Select
.
call
(
this
,
position
)
;
this
.
onChangeCallback
=
null
;
this
.
setOptions
(
{
'
true
'
:
'
true
'
,
'
false
'
:
'
false
'
}
);
this
.
dom
.
addEventListener
(
'
change
'
,
function
(
event
)
{
if
(
scope
.
onChangeCallback
)
scope
.
onChangeCallback
();
},
false
);
return
this
;
};
UI
.
Boolean
.
prototype
=
Object
.
create
(
UI
.
Selec
t
.
prototype
);
UI
.
Checkbox
.
prototype
=
Object
.
create
(
UI
.
Elemen
t
.
prototype
);
UI
.
Boolean
.
prototype
.
getValue
=
function
()
{
UI
.
Checkbox
.
prototype
.
getValue
=
function
()
{
return
this
.
dom
.
value
===
'
true
'
;
return
this
.
dom
.
checked
;
};
UI
.
Boolean
.
prototype
.
setValue
=
function
(
value
)
{
UI
.
Checkbox
.
prototype
.
setValue
=
function
(
value
)
{
this
.
dom
.
checked
=
value
;
return
this
;
this
.
dom
.
value
=
value
.
toString
();
};
UI
.
Checkbox
.
prototype
.
onChange
=
function
(
callback
)
{
this
.
onChangeCallback
=
callback
;
return
this
;
...
...
editor/js/ui/Sidebar.Properties.Material.js
浏览文件 @
927ef73a
...
...
@@ -176,7 +176,7 @@ Sidebar.Properties.Material = function ( signals ) {
// transparent
var
materialTransparentRow
=
new
UI
.
Panel
();
var
materialTransparent
=
new
UI
.
Boolean
(
'
absolute
'
).
setValue
(
false
).
setLeft
(
'
90px
'
).
onChange
(
update
);
var
materialTransparent
=
new
UI
.
Checkbox
(
'
absolute
'
).
setValue
(
false
).
setLeft
(
'
90px
'
).
onChange
(
update
);
materialTransparentRow
.
add
(
new
UI
.
HorizontalRule
(),
new
UI
.
Text
().
setValue
(
'
Transparent
'
).
setColor
(
'
#666
'
)
);
materialTransparentRow
.
add
(
materialTransparent
);
...
...
@@ -186,7 +186,7 @@ Sidebar.Properties.Material = function ( signals ) {
// wireframe
var
materialWireframeRow
=
new
UI
.
Panel
();
var
materialWireframe
=
new
UI
.
Boolean
(
'
absolute
'
).
setValue
(
false
).
setLeft
(
'
90px
'
).
onChange
(
update
);
var
materialWireframe
=
new
UI
.
Checkbox
(
'
absolute
'
).
setValue
(
false
).
setLeft
(
'
90px
'
).
onChange
(
update
);
materialWireframeRow
.
add
(
new
UI
.
HorizontalRule
(),
new
UI
.
Text
().
setValue
(
'
Wireframe
'
).
setColor
(
'
#666
'
)
);
materialWireframeRow
.
add
(
materialWireframe
);
...
...
editor/js/ui/Sidebar.Properties.Object3D.js
浏览文件 @
927ef73a
...
...
@@ -66,7 +66,7 @@ Sidebar.Properties.Object3D = function ( signals ) {
// visible
var
objectVisibleRow
=
new
UI
.
Panel
();
var
objectVisible
=
new
UI
.
Boolean
(
'
absolute
'
).
setLeft
(
'
90px
'
).
setWidth
(
'
5
0px
'
).
onChange
(
update
);
var
objectVisible
=
new
UI
.
Checkbox
(
'
absolute
'
).
setLeft
(
'
9
0px
'
).
onChange
(
update
);
objectVisibleRow
.
add
(
new
UI
.
HorizontalRule
(),
new
UI
.
Text
().
setValue
(
'
Visible
'
).
setColor
(
'
#666
'
)
);
objectVisibleRow
.
add
(
objectVisible
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录