Authored by 毕凯

code review by zhaobiao

... ... @@ -101,6 +101,9 @@ $addressForm.on('submit', function() {
});
$submit.on('touchend', function() {
if (security.hasDangerInput(false)) {
return false;
}
$input.blur();
$addressForm.submit();
return false;
... ...
... ... @@ -6,12 +6,9 @@
var $ = require('jquery'),
tip = require('../plugin/tip'),
security = require('../plugin/security'),
loading = require('../plugin/loading');
var $action = $('.action'),
$addressForm = $('.edit-address'),
$submit = $('.submit'),
$addAddress = $('.add-address'),
$footer = $('#yoho-footer'),
$confim = $('.confim-mask'),
... ... @@ -24,12 +21,13 @@ $pageWrap.first().css('min-height', function() {
});
window.rePosFooter();
$confim.on('touchend', '.cancel', function() {
$confim.on('touchend', '.cancel', function(e) {
deleteId = null;
$confim.hide();
$confim.fadeOut();
return false;
}).on('touchend', '.confim', function() {
loading.showLoadingMask();
$confim.hide();
$confim.fadeOut();
$.ajax({
method: 'POST',
url: '/home/delAddress',
... ... @@ -52,6 +50,7 @@ $confim.on('touchend', '.cancel', function() {
}).always(function() {
deleteId = null;
});
return false;
});
... ... @@ -69,17 +68,5 @@ $addAddress.on('touchend', function() {
// 删除
$action.on('touchend', '.del', function() {
deleteId = $(this).data('id');
$confim.show();
});
$submit.on('touchend', function() {
if (security.hasDangerInput(false)) {
return false;
}
$addressForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
$confim.fadeIn();
});
... ...