root 2 years ago
parent
commit
f4cb15f2e7
1 changed files with 21 additions and 16 deletions
  1. 21 16
      js/UForm/WindowFunction.js

+ 21 - 16
js/UForm/WindowFunction.js

@@ -11,7 +11,7 @@ U.UF.F.hisTory = true; //判断是否保留最大化之前的窗体宽、高、t
 *  由于在拖动拉伸等过程中可能会触发到其他iframe,这里就是全局遮罩,让拖动和拉伸的过程中,不回出发到下面的iframe
 */
 U.UF.F.maskFrame = function () {
-    return $$("div", { "style": { "cssText": "width:100%;height:100%;position:absolute;top:0;left:0;"} }, document.body);
+    return $$("div", { "style": { "cssText": "width:100%;height:100%;position:absolute;top:0;left:0;" } }, document.body);
 }
 
 /*
@@ -28,6 +28,11 @@ U.UF.F.windowZooming = function (el) {
     }
     //最大化处理
     else {
+        //判断是否一开始就是最大化
+        _ismax = document.body.offsetHeight == el.offsetHeight && document.body.offsetWidth == el.offsetWidth;
+        if (_ismax) {
+            el.style.cssText += "width:70%;height:90%;";
+        }
         el.initcsstext = el.style.cssText; //获取原本的csstext值
         el.ismaximize = true;
         //设置窗体最大化
@@ -38,7 +43,7 @@ U.UF.F.windowZooming = function (el) {
             "left": "0px"
         });
     }
-    U.MD.F.W.reSize();
+    //U.MD.F.W.reSize();
 }
 
 /*
@@ -76,9 +81,9 @@ U.UF.F.windowTopCenter = function (el) {
     //setTimeout(function () {
     //获取实际高度或者是当前窗口对于窗口显示区左上角的Y位置或者是整个body的实际高度
     var _scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
-    //获取整个页面的宽度
+        //获取整个页面的宽度
         _iwidth = document.documentElement.clientWidth,
-    //获取整个浏览器的宽度
+        //获取整个浏览器的宽度
         _iheight = document.documentElement.clientHeight; //_scrollTop * 2
     el.style.display = "block"; //先显示窗体
     _zindex = (US || parent.US).ZINDEX++;
@@ -101,15 +106,15 @@ U.UF.F.windowTopCenter = function (el) {
 U.UF.F.topWindow = function (el) {
     var _zindex,
         _el1 = U.UF.F.getWindow(el), //通过U.UF.F.getWindow()获取需要进行置顶的窗体元素
-		_el3; //获取需要置顶元素的父级元素
+        _el3; //获取需要置顶元素的父级元素
     if (_el1 && _el1.length || el && el.length) {//判断是否有需要置顶的窗体元素
         for (var i = 0; i < _el1.length; i++) {//循环判断有几个窗体元素
             _el3 = U.selectEl(_el1[i]).Parent();
             //判断 是否有获取需要置顶的窗体元素的父级元素 并且 需要置顶的元素是否符合document.body或者id是否符合"usestudio_server"或者id是否符合"U_MD_Home"三种中的一种,并且是否需要置顶的元素"__top__"不为false,并且操作指令为true或者返回值在字符串中首次出现的位置是否为-1
-            if (_el3 && (_el3 == document.body || _el3.id == "usestudio_server" ) && ($(_el1[i]).attr("__top__") != "false" && _el1[i]["__top__"] != "false")) {
+            if (_el3 && (_el3 == document.body || _el3.id == "usestudio_server") && ($(_el1[i]).attr("__top__") != "false" && _el1[i]["__top__"] != "false")) {
                 _zindex = (US || parent.US).ZINDEX++;
                 //如果符合全部要求,则给置顶元素添加一个style样式,z-index每一次置顶都在现有的z-index中加1,并且显示出来
-                U.selectEl(_el1[i]).addAttrArray({ "style": { "cssText": _el1[i].style.cssText + ";z-index:" + _zindex + ";display:block"} });
+                U.selectEl(_el1[i]).addAttrArray({ "style": { "cssText": _el1[i].style.cssText + ";z-index:" + _zindex + ";display:block" } });
             }
         }
     }
@@ -121,9 +126,9 @@ U.UF.F.topWindow = function (el) {
 */
 U.UF.F.getWindow = function (el) {
     var _arr = [], //先定义一个用于存储需要置顶元素的元素
-		_el2 = el, //获取整个窗体的元素
-		_el3 = document.body, //获取整个文档的body部分,不包括除body外的一切
-		_el4 = U.selectEl("#U_MD_Home")[0] || U.selectEl("#usestudio_server")[0] || _el3; //获取满足三个条件中的一个的元素
+        _el2 = el, //获取整个窗体的元素
+        _el3 = document.body, //获取整个文档的body部分,不包括除body外的一切
+        _el4 = U.selectEl("#U_MD_Home")[0] || U.selectEl("#usestudio_server")[0] || _el3; //获取满足三个条件中的一个的元素
     //判断是否有满足三个条件中的一个的元素
     if (_el4) {//如果有,则进行下面的语句
         //循环语句,整个窗体的元素为元素的offsetParent,并且.获取的窗体元素不为整个body的部分,也不是满足获取id为U_MD_Home和id为usestudio_server的元素,并且条件满足的情况下进行循环批判断,直到结果出现
@@ -455,12 +460,12 @@ U.UF.F.dragSelect = function (el, fun) {
             _dragel,
             _mousep = U.UF.EL.getMousePosition(el), //鼠标位置
             _record = { x: _mousep.x, y: _mousep.y },
-        //拖动函数的处理
+            //拖动函数的处理
             _mousemove = function () {
                 //拖动的处理
                 U.UF.F.dragSelect.drag(el, _mousep, _dragel, fun, _record);
             },
-        //拖动释放的处理
+            //拖动释放的处理
             _mouseup = function () {
                 U.selectEl(_dragel).remove();
                 //释放取消绑定的处理
@@ -479,7 +484,7 @@ U.UF.F.dragSelect = function (el, fun) {
         _x = _mousep.x; //鼠标的x轴坐标
         _y = _mousep.y; //鼠标的y轴坐标
         //创建选择元素
-        _dragel = $$("div", { "style": { "cssText": "position:absolute;width:0;height:0;font-size:0;margin:0;padding:0;border:1px solid #89b1e6;background-color:#c3d5ed;z-index:1000;filter:alpha(opacity:60);opacity:.6;background-image: url(/img/UXZT.png); display: inline-block; z-index: 1000; zoom: 1;" + "top:" + _y + "px;left:" + _x + "px;zIndex:" + US.ZINDEX + 1} }, el);
+        _dragel = $$("div", { "style": { "cssText": "position:absolute;width:0;height:0;font-size:0;margin:0;padding:0;border:1px solid #89b1e6;background-color:#c3d5ed;z-index:1000;filter:alpha(opacity:60);opacity:.6;background-image: url(/img/UXZT.png); display: inline-block; z-index: 1000; zoom: 1;" + "top:" + _y + "px;left:" + _x + "px;zIndex:" + US.ZINDEX + 1 } }, el);
         //绑定元素的处理
         U.selectEl(document).bind({
             "mousemove": _mousemove,
@@ -511,12 +516,12 @@ U.UF.F.dragSelect.drag = function (el, mouseup, dragel, fun, record) {
         _h = Math.abs(_ctop - _top), //拖动后的宽
         _l = Math.min(_cleft, _left), //拖动后的left
         _t = Math.min(_ctop, _top)    //拖动后的top
-    ;
+        ;
     //如果是滚动出发的则找不到鼠标的位置 所以需要通过记录去找
     record.x = _m.x;
     record.y = _m.y;
     //拉动大小变化 
-    U.selectEl(dragel).addAttrArray({ "style": { "cssText": "width:" + _w + "px;height:" + _h + "px;top:" + _t + "px;left:" + _l + "px;"} });
+    U.selectEl(dragel).addAttrArray({ "style": { "cssText": "width:" + _w + "px;height:" + _h + "px;top:" + _t + "px;left:" + _l + "px;" } });
     //设置拉伸选取的处理
     U.UF.F.dragSelect.isLocation(dragel, el, { "width": _w, "height": _h, "left": _l, "top": _t }, fun);
 }
@@ -534,7 +539,7 @@ U.UF.F.dragSelect.isLocation = function (dragel, el, obj, fun) {
         _height,
         _arr = [],
         _child = U.selectEl(el).Child() //所有的拖选取的元素
-    ;
+        ;
     //循环子元素的处理
     for (i = 0; i < _child.length; i++) {
         //处理的元素不是拖选元素