更新打开窗口的方式

fix 窗口无法移动的bug
This commit is contained in:
yumo 2023-03-10 22:16:53 +08:00
parent ad0673f8a8
commit 294ba1375f
6 changed files with 27 additions and 21 deletions

View File

@ -734,6 +734,7 @@ body .mac-btn_refresh {
} }
.mac-open-iframe .layui-layer-setwin { .mac-open-iframe .layui-layer-setwin {
width: 10rem; /*需要定义长度避免影响拖动 多预留一个button位置*/
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;

2
css/index.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -155,8 +155,6 @@
src="./img/icon/icloud.png"></a></li> src="./img/icon/icloud.png"></a></li>
<li><span class="dock-tips">prefapp<span class="arrow"></span></span><a href="#"> <img <li><span class="dock-tips">prefapp<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/prefapp.png"></a></li> src="./img/icon/prefapp.png"></a></li>
<li><span class="dock-tips">trashicon<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/trashicon.png"></a></li>
<li><span class="dock-tips">appstore<span class="arrow"></span></span><a href="#"> <img <li><span class="dock-tips">appstore<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/appstore.png"></a></li> src="./img/icon/appstore.png"></a></li>
<li><span class="dock-tips">iTunes<span class="arrow"></span></span><a href="#"> <img <li><span class="dock-tips">iTunes<span class="arrow"></span></span><a href="#"> <img
@ -179,6 +177,8 @@
src="./img/icon/facetime.png"></a></li> src="./img/icon/facetime.png"></a></li>
<li><span class="dock-tips">launchpad<span class="arrow"></span></span><a href="#"> <img <li><span class="dock-tips">launchpad<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/launchpad.png"></a></li> src="./img/icon/launchpad.png"></a></li>
<li id="trashicon"><span class="dock-tips">trashicon<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/trashicon.png"></a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -109,10 +109,8 @@
src="./img/icon/icloud.png"></a></li> src="./img/icon/icloud.png"></a></li>
<li><span class="dock-tips">prefapp<span class="arrow"></span></span><a href="#"> <img <li><span class="dock-tips">prefapp<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/prefapp.png"></a></li> src="./img/icon/prefapp.png"></a></li>
<li><span class="dock-tips">trashicon<span class="arrow"></span></span><a href="#"> <img <li id="trashicon"><span class="dock-tips">trashicon<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/trashicon.png"></a></li> src="./img/icon/trashicon.png"></a></li>
<li><span class="dock-tips">appstore<span class="arrow"></span></span><a href="#"> <img
src="./img/icon/appstore.png"></a></li>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -10,6 +10,7 @@ window.Macui = {
}, },
_wallpaperBlur: true, //壁纸模糊(影响性能) _wallpaperBlur: true, //壁纸模糊(影响性能)
_countTask: 0, _countTask: 0,
_maxTask:12,
_newMsgCount: 0, _newMsgCount: 0,
_animated_classes: [], _animated_classes: [],
_animated_liveness: 0, _animated_liveness: 0,
@ -199,7 +200,7 @@ window.Macui = {
let max_index = 0, let max_index = 0,
max_z = 0, max_z = 0,
btn = null; btn = null;
$("#mac_btn_group_middle .btn.show").each(function () { $("#dock .dock-container li.show").each(function () {
let index = $(this).attr('index'); let index = $(this).attr('index');
let layero = Macui.getLayeroByIndex(index); let layero = Macui.getLayeroByIndex(index);
let z = layero.css('z-index'); let z = layero.css('z-index');
@ -210,7 +211,7 @@ window.Macui = {
} }
}); });
this._settop(max_index); this._settop(max_index);
$("#mac_btn_group_middle .btn").removeClass('active'); $("#dock .dock-container li").removeClass('active');
if (btn) { if (btn) {
btn.addClass('active'); btn.addClass('active');
} }
@ -260,7 +261,7 @@ window.Macui = {
layer.close(index); layer.close(index);
Macui._checkTop(); Macui._checkTop();
Macui._countTask--; //回退countTask数 Macui._countTask--; //回退countTask数
Macui._renderBar(); Macui.renderDocks();
}, },
_fixWindowsHeightAndWidth: function () { _fixWindowsHeightAndWidth: function () {
//此处代码修正全屏切换引起的子窗体尺寸超出屏幕 //此处代码修正全屏切换引起的子窗体尺寸超出屏幕
@ -466,12 +467,15 @@ window.Macui = {
$("#mac-shortcuts").removeClass('shortcuts-hidden'); //显示图标 $("#mac-shortcuts").removeClass('shortcuts-hidden'); //显示图标
Macui._showShortcut(); //显示图标 Macui._showShortcut(); //显示图标
Macui.renderDocks(); //渲染DOCK Macui.renderDocks(); //渲染DOCK
//初始化任务数量
this._maxTask = parseInt((document.body.clientWidth - 10) / 60)
//窗口改大小,重新渲染 //窗口改大小,重新渲染
$(window).resize(function () { $(window).resize(function () {
Macui.renderShortcuts(); Macui.renderShortcuts();
Macui._checkBgUrls(); Macui._checkBgUrls();
if (!Macui.isSmallScreen()) Macui._fixWindowsHeightAndWidth(); //2017年11月14日修改加入了if条件 if (!Macui.isSmallScreen()) Macui._fixWindowsHeightAndWidth(); //2017年11月14日修改加入了if条件
Macui.renderDocks(); Macui.renderDocks();
this._maxTask = parseInt((parseInt(document.body.clientWidth) - 10) / 60)
}); });
//打广告 //打广告
setTimeout(function () { setTimeout(function () {
@ -1099,7 +1103,7 @@ window.Macui = {
} }
*/ */
//只打开一个应用代码结束,备注,本地方法有点问题,需要全部使用 url才能生效 //只打开一个应用代码结束,备注,本地方法有点问题,需要全部使用 url才能生效
if (this._countTask > 12) { if ($("#dock .dock-container").children('li').length > this._maxTask) {
layer.msg("您打开的太多了,歇会儿吧~"); layer.msg("您打开的太多了,歇会儿吧~");
return false; return false;
} else { } else {
@ -1164,9 +1168,9 @@ window.Macui = {
layero_opened.css('top', 24); layero_opened.css('top', 24);
}, },
}); });
$('#mac_btn_group_middle .btn.active').removeClass('active'); $('#dock .dock-container li.active').removeClass('active');
let btn = $('<div id="mac_' + index + '" index="' + index + let btn = $('<li id="mac_' + index + '" index="' + index +
'" class="btn show active"><div class="btn_title">' + icon + '</div></div>'); '"> <span class="dock-tips" style="display: none;">'+title+'<span class="arrow"></span></span><a>' + icon + '</a> </li>');
let layero_opened = Macui.getLayeroByIndex(index); let layero_opened = Macui.getLayeroByIndex(index);
layero_opened.css('z-index', Macui._countTask + 813); layero_opened.css('z-index', Macui._countTask + 813);
Macui._settop(layero_opened); Macui._settop(layero_opened);
@ -1191,10 +1195,14 @@ window.Macui = {
height - 55); height - 55);
} }
}, 300); }, 300);
}); });
$("#mac_btn_group_middle").append(btn); //回收站存在则插入回收站之前不存在则直接追加
Macui._renderBar(); if ($("#trashicon")){
btn.insertBefore($("#trashicon"))
}else{
$("#dock .dock-container>li").append(btn);
}
Macui.renderDocks();
btn.click(function () { btn.click(function () {
let index = $(this).attr('index'); let index = $(this).attr('index');
let layero = Macui.getLayeroByIndex(index); let layero = Macui.getLayeroByIndex(index);
@ -1217,20 +1225,19 @@ window.Macui = {
Macui._checkTop(); Macui._checkTop();
layero.hide(); layero.hide();
} else { } else {
$('#mac_btn_group_middle .btn.active').removeClass('active'); $('#dock .dock-container li.active').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
Macui._settop(layero); Macui._settop(layero);
} }
} else { } else {
$(this).addClass('show'); $(this).addClass('show');
$('#mac_btn_group_middle .btn.active').removeClass('active'); $('#dock .dock-container li.active').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
Macui._settop(layero); Macui._settop(layero);
layero.show(); layero.show();
} }
}); });
Macui._iframeOnClick.track(layero_opened.find('iframe:first')[0], function () { Macui._iframeOnClick.track(layero_opened.find('iframe:first')[0], function () {
if (Object.getOwnPropertyNames(Macui._iframe_click_lock_children).length === 0) { if (Object.getOwnPropertyNames(Macui._iframe_click_lock_children).length === 0) {
Macui._settop(layero_opened); Macui._settop(layero_opened);
@ -1248,7 +1255,7 @@ window.Macui = {
$(".mac-open-iframe").remove(); $(".mac-open-iframe").remove();
$("#mac_btn_group_middle").html(""); $("#mac_btn_group_middle").html("");
Macui._countTask = 0; Macui._countTask = 0;
Macui._renderBar(); Macui.renderDocks();
}, },
setAnimated: function (animated_classes, animated_liveness) { setAnimated: function (animated_classes, animated_liveness) {
this._animated_classes = animated_classes; this._animated_classes = animated_classes;

2
js/index.min.js vendored

File diff suppressed because one or more lines are too long