Skip to content

Commit

Permalink
list
Browse files Browse the repository at this point in the history
  • Loading branch information
zdhxiong committed Nov 18, 2016
1 parent 83c3135 commit 822763c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
32 changes: 25 additions & 7 deletions src/list/less/list.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.mdui-list {
padding: 8px 0;
background-color: #fff;
list-style: none;

&>.mdui-divider {
margin-top: 8px;
Expand All @@ -22,7 +23,9 @@
box-sizing: border-box;
padding: 0 16px;
min-height: 48px;
color: @color-black-text;
cursor: pointer;
text-decoration: none;
transition: background-color .3s @animation-curve-default;

&:hover {
Expand Down Expand Up @@ -54,19 +57,13 @@
/* 列表项内容 */
.mdui-list-item-content {
flex-grow: 1;
color: @color-black-text;
font-weight: 400;
font-size: 16px;
line-height: 20px;
padding-top: 14px;
padding-bottom: 14px;
}

/* 列表项内容的主内容 */
.mdui-list-item-title {
.mdui-text-truncate();
}

/* 列表项内容的副内容 */
.mdui-list-item-text {
color: @color-black-secondary;
Expand All @@ -78,6 +75,28 @@
}
}

/* 限制文本高度 */
.mdui-list-item-one-line,
.mdui-list-item-two-line,
.mdui-list-item-three-line {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.mdui-list-item-one-line {
-webkit-line-clamp: 1;
height: 20px;
}
.mdui-list-item-two-line {
-webkit-line-clamp: 2;
height: 40px;
}
.mdui-list-item-three-line {
-webkit-line-clamp: 3;
height: 60px;
}

/* 列表项内的元素间添加间距 */
.mdui-list-item-icon {
~ .mdui-list-item-content {
Expand All @@ -96,7 +115,6 @@
}
}


/* 密集型列表 */
.mdui-list-dense {
padding: 4px 0;
Expand Down
10 changes: 5 additions & 5 deletions src/menu/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,11 @@ mdui.Menu = (function () {
});

// 点击不含子菜单的菜单条目关闭菜单
/*$.on(document, 'click', '.' + CLASS.item, function () {
if (!$.query('.' + CLASS.menu, this)) {
_this.close();
}
});*/
$.on(document, mdui.touchEvents.end, '.' + CLASS.item, function () {
if (!$.query('.' + CLASS.menu, this) && !this.classList.contains(CLASS.disabled)) {
_this.close();
}
});

// 绑定点击或鼠标移入含子菜单的条目的事件
bindSubMenuEvent(_this);
Expand Down
3 changes: 1 addition & 2 deletions src/panel/less/panel.less
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
font-size: 15px;
cursor: pointer;
will-change: height, line-height, background-color;
transition: all .3s @animation-curve-default,
background-color .2s @animation-curve-fast-out-linear-in;
transition: all .3s @animation-curve-default;

&:active {
background-color: @color-grey-200;
Expand Down

0 comments on commit 822763c

Please sign in to comment.