From d7c0a536eab47000f6285debee8a047abd494436 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 17 Oct 2024 12:13:45 +0800 Subject: [PATCH] add some --- frame.js | 2 +- plugin/local/chat/iframe.js | 4 +++- plugin/state.js | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frame.js b/frame.js index 27031506..439abe47 100644 --- a/frame.js +++ b/frame.js @@ -1181,7 +1181,7 @@ Volcanos(chat.ONMOTION, { }, float: function(can) { var target = can._fields||can._target, sup = can._fields? can.sup: can var margin = (can.getFooterHeight()||html.ACTION_HEIGHT)+(can.user.isMobile? html.ACTION_HEIGHT: 0)+html.PLUGIN_MARGIN - var height = can.base.Max(html.FLOAT_HEIGHT, can.page.height()-can.getHeaderHeight()-margin), width = can.base.Max(html.FLOAT_WIDTH, can.page.width()-can.getRiverWidth()-2*html.PLUGIN_MARGIN) + var height = can.base.Max(can.Conf("_height")||html.FLOAT_HEIGHT, can.page.height()-can.getHeaderHeight()-margin), width = can.base.Max(can.Conf("_width")||html.FLOAT_WIDTH, can.page.width()-can.getRiverWidth()-2*html.PLUGIN_MARGIN) sup.onimport.size(sup, height, width, false), can.onappend.style(can, html.FLOAT) can.onmotion.resize(can, target, function(height, width) { sup.onimport.size(sup, height, width, false) }, can.getHeaderHeight(), can.getRiverWidth()) var left = can.page.width()-width-html.PLUGIN_MARGIN, top = can.page.height()-height-margin diff --git a/plugin/local/chat/iframe.js b/plugin/local/chat/iframe.js index e875ab74..50416698 100644 --- a/plugin/local/chat/iframe.js +++ b/plugin/local/chat/iframe.js @@ -1,4 +1,6 @@ -Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.db.current = msg.TableDetail() +Volcanos(chat.ONIMPORT, { + _init: function(can, msg) { can.db.current = msg.TableDetail() + can.Conf("_width") && can.sup.onimport.size(can.sup, can.Conf("_height"), can.Conf("_width"), false) can.ui.target = can.page.Appends(can, can._output, [{type: html.IFRAME, src: can.db.current.link, height: can.ConfHeight(), width: can.ConfWidth()}])._target can.page.style(can, can._output, "overflow-y", html.HIDDEN) can.sup.onexport.link = function() { return can.db.current.link } diff --git a/plugin/state.js b/plugin/state.js index d1d39e70..de92cd64 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -40,6 +40,7 @@ Volcanos(chat.ONIMPORT, { var option = can.base.Obj(msg.Option("field.option")) msg.Table(function(item) { tabs && can.onmotion.cache(can, function() { return tabHash }) var sup = item.space? can._root.Action: can + height = item._height||height, width = item._width||width 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)