Authored by 梁志锋

个人中心浏览记录页 删除成功的延迟时间 code review by chenglong.wang

... ... @@ -109,16 +109,13 @@ $page.on('touchstart', '.del-icon', function() {
if (data.code === 200) {
dialog.showDialog({
dialogText: '删除浏览记录成功',
autoHide: true,
autoHide: 2000,
fast: true
});
setTimeout(function() {
window.history.go(0);
}, 2500);
}, 2000);
}
},
complete: function() {
dialog.hideDialog(); //隐藏dialog
}
});
});
... ...
... ... @@ -37,6 +37,7 @@ exports.showDialog = function(data, callback) {
var dialogStr = dialogTemplate(data),
$dialogBox,
defaultHideDuraton,
dialogWrapperHammer;
$('.dialog-wrapper').remove();
... ... @@ -63,9 +64,13 @@ exports.showDialog = function(data, callback) {
//隐藏
if (data.autoHide) {
defaultHideDuraton = 1000;
if (data.autoHide > 1) {
defaultHideDuraton = data.autoHide;
}
setTimeout(function() {
$dialogWrapper.fadeOut();
}, 1000);
}, defaultHideDuraton);
}
dialogWrapperHammer.on('tap', function(event) {
... ... @@ -76,9 +81,6 @@ exports.showDialog = function(data, callback) {
callback();
}
});
};
exports.hideDialog = function() {
$dialogWrapper.fadeOut();
};
... ...