From f9b03ddcbc20264b80fa98d30e3dc8bc5dd5bbea Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 16 Apr 2007 02:51:41 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1152 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/plugin/tpl/js/plugin_admin.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/plugin/tpl/js/plugin_admin.js b/modules/plugin/tpl/js/plugin_admin.js index be42b7703..fc1cde226 100644 --- a/modules/plugin/tpl/js/plugin_admin.js +++ b/modules/plugin/tpl/js/plugin_admin.js @@ -22,6 +22,17 @@ function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) { return; } + var orig_width = 0; + var orig_height = 0; + var node = opener.editorPrevNode; + if(node) { + orig_width = parseInt(xWidth(node),10)-6; + orig_height = parseInt(xHeight(node),10)-6; + + plugin_code = plugin_code.replace(/width([^p]+)px/ig,'width:'+orig_width+'px'); + plugin_code = plugin_code.replace(/height([^p]+)px/ig,'height:'+orig_height+'px'); + } + opener.editorFocus(module_srl); var iframe_obj = opener.editorGetIFrame(module_srl); opener.editorReplaceHTML(iframe_obj, plugin_code);