Authored by xuqi

address detail in 2 lines

... ... @@ -102,6 +102,7 @@
"yoho-handlebars": "^4.0.5",
"yoho-jquery": "^1.12.4",
"yoho-jquery-accordion": "0.0.2",
"yoho-jquery-dotdotdot": "0.0.1",
"yoho-jquery-lazyload": "^1.9.7",
"yoho-jquery-nanoscroller": "0.0.1",
"yoho-jquery-placeholder": "^2.3.1",
... ...
... ... @@ -18,6 +18,15 @@ var Dialog = popup.Dialog,
var addressDialogTpl;
var addressTpl;
require('yoho-jquery-dotdotdot');
// dot someone
function dotYou($el) {
$el.find('.address-detail').dotdotdot({
wrap: 'letter'
});
}
// 判断是否是Y
Hbs.registerHelper('isY', function(value, options) {
if (value === 'Y') {
... ... @@ -188,6 +197,8 @@ function addressDialogFactory(opt, $the) {
receiver(updated);
}
dotYou($the.prev('.address'));
$the.remove();
address.close();
}
... ... @@ -221,6 +232,8 @@ function addressDialogFactory(opt, $the) {
address: [the]
}));
dotYou($('#address-list .address').first());
// 若添加后有20个地址则隐藏新增的按钮
if ($('#address-list .address').length === 20) {
$('#address-list .new-address-block').addClass('hide');
... ... @@ -425,6 +438,8 @@ $.ajax({
hasNew: data.data.length >= 20 ? false : true
}));
dotYou($('.address'));
// 填收货人信息
receiver(data.data[0]);
}
... ...
... ... @@ -145,6 +145,7 @@
.address-detail {
line-height: 15px;
max-height: 30px;
}
.address-detail,
... ...