Authored by 毕凯

地址管理 取消删除穿透, 弹窗加过渡

@@ -101,6 +101,9 @@ $addressForm.on('submit', function() { @@ -101,6 +101,9 @@ $addressForm.on('submit', function() {
101 }); 101 });
102 102
103 $submit.on('touchend', function() { 103 $submit.on('touchend', function() {
  104 + if (security.hasDangerInput(false)) {
  105 + return false;
  106 + }
104 $input.blur(); 107 $input.blur();
105 $addressForm.submit(); 108 $addressForm.submit();
106 return false; 109 return false;
@@ -6,12 +6,9 @@ @@ -6,12 +6,9 @@
6 6
7 var $ = require('jquery'), 7 var $ = require('jquery'),
8 tip = require('../plugin/tip'), 8 tip = require('../plugin/tip'),
9 - security = require('../plugin/security'),  
10 loading = require('../plugin/loading'); 9 loading = require('../plugin/loading');
11 10
12 var $action = $('.action'), 11 var $action = $('.action'),
13 - $addressForm = $('.edit-address'),  
14 - $submit = $('.submit'),  
15 $addAddress = $('.add-address'), 12 $addAddress = $('.add-address'),
16 $footer = $('#yoho-footer'), 13 $footer = $('#yoho-footer'),
17 $confim = $('.confim-mask'), 14 $confim = $('.confim-mask'),
@@ -24,12 +21,13 @@ $pageWrap.first().css('min-height', function() { @@ -24,12 +21,13 @@ $pageWrap.first().css('min-height', function() {
24 }); 21 });
25 window.rePosFooter(); 22 window.rePosFooter();
26 23
27 -$confim.on('touchend', '.cancel', function() { 24 +$confim.on('touchend', '.cancel', function(e) {
28 deleteId = null; 25 deleteId = null;
29 - $confim.hide(); 26 + $confim.fadeOut();
  27 + return false;
30 }).on('touchend', '.confim', function() { 28 }).on('touchend', '.confim', function() {
31 loading.showLoadingMask(); 29 loading.showLoadingMask();
32 - $confim.hide(); 30 + $confim.fadeOut();
33 $.ajax({ 31 $.ajax({
34 method: 'POST', 32 method: 'POST',
35 url: '/home/delAddress', 33 url: '/home/delAddress',
@@ -52,6 +50,7 @@ $confim.on('touchend', '.cancel', function() { @@ -52,6 +50,7 @@ $confim.on('touchend', '.cancel', function() {
52 }).always(function() { 50 }).always(function() {
53 deleteId = null; 51 deleteId = null;
54 }); 52 });
  53 + return false;
55 }); 54 });
56 55
57 56
@@ -69,17 +68,5 @@ $addAddress.on('touchend', function() { @@ -69,17 +68,5 @@ $addAddress.on('touchend', function() {
69 // 删除 68 // 删除
70 $action.on('touchend', '.del', function() { 69 $action.on('touchend', '.del', function() {
71 deleteId = $(this).data('id'); 70 deleteId = $(this).data('id');
72 - $confim.show();  
73 -});  
74 -  
75 -$submit.on('touchend', function() {  
76 - if (security.hasDangerInput(false)) {  
77 - return false;  
78 - }  
79 - $addressForm.submit();  
80 - return false;  
81 -}).on('touchstart', function() {  
82 - $(this).addClass('highlight');  
83 -}).on('touchend touchcancel', function() {  
84 - $(this).removeClass('highlight'); 71 + $confim.fadeIn();
85 }); 72 });