style: text overflow

This commit is contained in:
devezhao 2020-03-27 13:25:24 +08:00
parent 3a0c548289
commit e32001faf7
3 changed files with 22 additions and 12 deletions

View file

@ -1430,6 +1430,7 @@ th.column-fixed {
.main-content>.nav-tabs-classic>li.nav-item a.nav-link {
padding: 11px 15px;
min-width: 101px;
max-width: 245px;
}
.sortable-box-title {
@ -3386,9 +3387,16 @@ a.icon-link>.zmdi {
}
/* text overflow */
.aside-header .title,
.dept-tree ul li a {
.dept-tree ul li a,
.nav-tabs>li.nav-item a.nav-link,
.dropdown-item {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.nav-tabs>li.nav-item a.nav-link {
max-width: 200px;
}

View file

@ -96,7 +96,6 @@ body {
.nav-tabs>li.nav-item a.nav-link {
padding: 11px 10px;
max-width: 130px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

View file

@ -225,25 +225,26 @@ var __checkMessage = function () {
else $('.J_notifications-top .indicator').addClass('hide')
if (__checkMessage__state !== res.data.unread) {
__checkMessage__state = res.data.unread
if (__checkMessage__state > 0) {
if (!window.__doctitle) window.__doctitle = document.title
document.title = '(' + __checkMessage__state + ') ' + window.__doctitle
if (rb.env === 'dev') __showNotification()
}
__loadMessages__state = 0
__loadMessages_state = false
}
__checkMessage__state = res.data.unread
setTimeout(__checkMessage, rb.env === 'dev' ? 60 * 10000 : 2000)
})
}
var __loadMessages__state = 0
var __loadMessages_state = false
var __loadMessages = function () {
if (__loadMessages__state === 1) return
if (__loadMessages_state) return
var dest = $('.rb-notifications .content ul').empty()
if (dest.find('li').length === 0) {
$('<li class="text-center mt-3 mb-3"><i class="zmdi zmdi-refresh zmdi-hc-spin fs-18"></i></li>').appendTo(dest)
}
$.get('/notification/messages?pageSize=10&preview=true', function (res) {
dest.empty()
$(res.data).each(function (idx, item) {
@ -255,18 +256,20 @@ var __loadMessages = function () {
$('<div class="text text-truncate">' + item[1] + '</div>').appendTo(o)
$('<span class="date">' + item[2] + '</span>').appendTo(o)
})
__loadMessages__state = 1
__loadMessages_state = true
if (res.data.length === 0) $('<li class="text-center mt-4 mb-4 text-muted">暂无消息</li>').appendTo(dest)
})
}
var __showNotification = function () {
if (window.Notification) {
if (window.Notification.permission === 'granted') {
new Notification('你有 ' + __checkMessage__state + ' 条未读消息', {
tag: 'rbNotification'
var _Notification = window.Notification || window.mozNotification || window.webkitNotification
if (_Notification) {
if (_Notification.permission === 'granted') {
new _Notification('你有 ' + __checkMessage__state + ' 条未读消息', {
tag: 'rbNotification',
icon: rb.baseUrl + '/assets/img/favicon.png',
})
} else {
window.Notification.requestPermission()
_Notification.requestPermission()
}
}
}