diff --git a/frame.js b/frame.js index 863deb1d..239756db 100644 --- a/frame.js +++ b/frame.js @@ -669,14 +669,14 @@ Volcanos(chat.ONAPPEND, { if (key == mdb.STATUS && can.base.isIn(value, mdb.ENABLE, ice.TRUE)) { _value = `` function onclick() { run(event, mdb.MODIFY, [mdb.STATUS, mdb.DISABLE]); return true } } - if (key == mdb.ENABLE) { + if (key == mdb.DISABLE) { if (value == ice.TRUE) { _value = `` function onclick() { run(event, mdb.MODIFY, [key, ice.FALSE]); return true } } else { _value = `` function onclick() { run(event, mdb.MODIFY, [key, ice.TRUE]); return true } } } - if (key == mdb.DISABLE) { + if (key == mdb.ENABLE) { if (value == ice.FALSE) { _value = `` function onclick() { run(event, mdb.MODIFY, [key, ice.TRUE]); return true } } else { _value = `` diff --git a/index.css b/index.css index c64655ce..8512bf80 100644 --- a/index.css +++ b/index.css @@ -210,7 +210,7 @@ div.item.card div.title span.role { border:var(--box-notice); color:var(--notice div.item.card div.title span.status { border:var(--box-notice); color:var(--notice-bg-color); font-size:12px; padding:0 5px; margin-left:5px; } div.item.card div.status { font-size:12px; color:gray; } div.item.card div.status span { margin-right:5px; } -div.item.card div.action { height:40px; } +div.item.card div.action { max-width:200px; display:flex; align-items:center; } div.item.card div.action { position:absolute; right:0; } div.item.card div.action input[type=button] { border:none; margin-left:5px; } div.item.card div.action input[type=button].danger { color:var(--danger-bg-color) } diff --git a/plugin/state.js b/plugin/state.js index f480a8a9..642da951 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -38,8 +38,9 @@ Volcanos(chat.ONIMPORT, { } var option = can.base.Obj(msg.Option("field.option")) msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash }) - can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) - sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)||item.index; can.run(can.request(event, {pod: item.space}, option), (msg[ice.FIELD_PREFIX]? msg[ice.FIELD_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) } + var sup = item.space? can._root.Action: can + can.onappend._plugin(sup, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) + sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)||item.index; sup.run(can.request(event, {pod: item.space}, option), (msg[ice.FIELD_PREFIX]? msg[ice.FIELD_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) } can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, !can.user.isMobile), cb && cb(sub) if (item.style == html.FLOAT) { return } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300) sub.onexport.output = function() { if (tabs) { msg.Option(ice.MSG_ACTION) && can.onappend._action(can, msg.Option(ice.MSG_ACTION))