forked from x/volcanos
opt some
This commit is contained in:
parent
fcbb7cd587
commit
9e494114c8
4
frame.js
4
frame.js
@ -195,16 +195,18 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
|||||||
_list.push(mdb.PREV, mdb.NEXT)
|
_list.push(mdb.PREV, mdb.NEXT)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
(function() {
|
||||||
var item = can.core.SplitInput(list[i], html.BUTTON);
|
var item = can.core.SplitInput(list[i], html.BUTTON);
|
||||||
if (item.type == html.SELECT) {
|
if (item.type == html.SELECT) {
|
||||||
item._init = function(target) {
|
item._init = function(target) {
|
||||||
target.value = item.value
|
target.value = item.value||item.values[0]
|
||||||
target.onchange = function(event) { can.run(event) }
|
target.onchange = function(event) { can.run(event) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.action && (function() {
|
item.action && (function() {
|
||||||
item._init = function(target) { can.onappend.figure(can, item, target) }
|
item._init = function(target) { can.onappend.figure(can, item, target) }
|
||||||
})(), item.type == html.BUTTON? _list.push(list[i]): _list.push(item)
|
})(), item.type == html.BUTTON? _list.push(list[i]): _list.push(item)
|
||||||
|
}) ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
meta = meta||can.onaction, action = action||can._action, can.onmotion.clear(can, action)
|
meta = meta||can.onaction, action = action||can._action, can.onmotion.clear(can, action)
|
||||||
|
@ -184,10 +184,9 @@ Volcanos("core", {help: "数据结构",
|
|||||||
case "=":
|
case "=":
|
||||||
if (res[mdb.TYPE] == html.SELECT) {
|
if (res[mdb.TYPE] == html.SELECT) {
|
||||||
res.values = this.Split(ls[i+1])
|
res.values = this.Split(ls[i+1])
|
||||||
for (var i = 1; i < res.values.length; i++) {
|
for (var j = 1; j < res.values.length; j++) {
|
||||||
if (res.values[0] == res.values[i]) {
|
if (res.values[0] == "" || res.values[0] == res.values[j]) {
|
||||||
res.value = res.values[0]
|
res.value = res.values[0], res.values = res.values.slice(1)
|
||||||
res.values = res.values.slice(1)
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ Volcanos("page", {help: "用户界面", ClassList: {
|
|||||||
return can.core.List(target && target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs)
|
return can.core.List(target && target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs)
|
||||||
}),
|
}),
|
||||||
Modify: shy("修改节点", function(can, target, value) { target = target||{}
|
Modify: shy("修改节点", function(can, target, value) { target = target||{}
|
||||||
target = can.base.isObject(target)? target: document.querySelector(target)
|
target = can.base.isObject(target)? target: document.querySelector(target); if (!target) { return }
|
||||||
can.base.isString(value)? (target.innerHTML = value): can.core.Item(value, function(key, val) {
|
can.base.isString(value)? (target.innerHTML = value): can.core.Item(value, function(key, val) {
|
||||||
!can.base.isObject(val)? (target[key] = val): can.core.Item(val, function(k, v) {
|
!can.base.isObject(val)? (target[key] = val): can.core.Item(val, function(k, v) {
|
||||||
var size = {
|
var size = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user