From 4b2457b1050a025942bfe3e398816151f67bac6a Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 7 Feb 2024 17:45:01 +0800 Subject: [PATCH] add some --- frame.js | 2 +- lib/user.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frame.js b/frame.js index d99d2c2f..9b366e71 100644 --- a/frame.js +++ b/frame.js @@ -764,7 +764,7 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro if (right) { layout.top = top+can.base.Min(height-target.offsetHeight, 0) } else if (rect.top-top-rect.height > top+height-rect.top) { - layout.top = top+can.base.Min(rect.top-target.offsetHeight, 0), height = rect.top-top + layout.top = can.base.Min(rect.top-target.offsetHeight, top) } } } diff --git a/lib/user.js b/lib/user.js index ea0df567..d38a8395 100644 --- a/lib/user.js +++ b/lib/user.js @@ -208,8 +208,9 @@ Volcanos("user", { can.core.CallFunc(cb, {event: can.request(event, {_handle: ice.TRUE})._event, button: button, data: data, list: list, args: args, input: action}) || action.cancel() }, _target: ui._target, _engine: function(event, can, button) { action.submit(event, can, button) }, }); - if (event && event.target) { can.onlayout.figure(event, can, ui._target) - can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, can.getHeaderHeight(can)) + if (event && event.target) { + can.onlayout.figure(event, can, ui._target) + can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, can.getHeaderHeight(can)) } else { can.getActionSize(function(left, top, height) { can.page.style(can, ui._target, html.LEFT, left||0, html.TOP, (height/4||0)) }) } can.onmotion.resize(can, ui._target), can.onmotion.delay(can, function() { action.focus() }, 300)