bank_card.js
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Created by moli on 15/9/14.
*/
define(function(require, exports, module) {
var $ = require("jquery"),
Alert = require("Alert");
require("swipe");
require("popup");
$(function(){
var methods = {
thisView : null,
hideDel : function(e){
if(e){methods.thisView = $(e)};
methods.thisView.find(".bank-view").animate({"left":"-52px"},400);
methods.thisView.find(".del").animate({"right":"0px"},400);
},
showDel : function(e){
if(e){methods.thisView = $(e)};
methods.thisView.find(".bank-view").animate({"left":"0px"},400);
methods.thisView.find(".del").animate({"right":"-75px"},400);
}
};
$(".cell").swipe({
swipe:function(event, direction, distance, duration, fingerCount) {
if(direction == "left"){
methods.hideDel(this);
}else if(direction == "right"){
methods.showDel(this);
}
}
});
$("#closeDelBank").bind("click", function(){
methods.thisView.remove();
Alert.show('删除成功');
});
$("#cancelDelBank").bind("click", function(){
methods.showDel();
});
});
});