feat: Blazor 多 Tabs 挂架脚本功能增强

This commit is contained in:
Argo Zhang 2020-03-20 12:10:50 +08:00
parent 2422950925
commit 33641b85d8
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
4 changed files with 17 additions and 3 deletions

View File

@ -92,8 +92,8 @@
</div>
}
<div class="@(EnableBlazor ? "dropdown" : "dropdown d-none")">
<a class="shadow-success dropdown-mvc" href="Admin/Index" )" data-toggle="tooltip" title="NETCore MVC 模式">
<img src="images/netcore2.png" )" />
<a class="shadow-success dropdown-mvc" href="#" data-method="blazor" data-toggle="tooltip" title="NETCore MVC 模式">
<img src="images/netcore2.png" />
</a>
</div>
</div>

View File

@ -91,7 +91,7 @@
</div>
}
<div class="@(Model.EnableBlazor ? "dropdown" : "dropdown d-none")">
<a class="shadow-success dropdown-blazor" href="~/Pages" data-toggle="tooltip" title="Blazor 多 Tabs 模式">
<a class="shadow-success dropdown-blazor" data-method="blazor" href="#" data-toggle="tooltip" title="Blazor 多 Tabs 模式">
<img src="~/images/blazor.svg" />
</a>
</div>

View File

@ -263,6 +263,12 @@
})
.on('inserted.bs.tooltip', '.is-invalid', function () {
$('#' + $(this).attr('aria-describedby')).addClass('is-invalid');
})
.on('click', '[data-method="blazor"]', function (e) {
e.preventDefault();
var path = window.location.pathname.replace('/Pages', '');
var search = window.location.search;
window.location = path + search;
});
});
})(jQuery);

View File

@ -165,6 +165,14 @@ $(function () {
// enable animoation effect
$('body').removeClass('trans-mute');
// blazor widget 切换功能
$('[data-method="blazor"]').on('click', function (e) {
e.preventDefault();
var path = window.location.pathname;
var search = window.location.search;
window.location = $.formatUrl("Pages" + path + search);
});
// 自动锁屏功能
var mousePosition = { screenX: 0, screenY: 0 };
var count = 1;