Skip to content

Commit ec6fa53

Browse files
committed
Cs fixes
1 parent bd2dcdf commit ec6fa53

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

examples/client_zepto.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@
2424
var li = $(this).parent('li');
2525
var id = li.find('span.id').text();
2626
var content = li.find('span.content').text();
27-
content = prompt('Value',content);
27+
content = prompt('Value', content);
2828
if (content!==null) {
29-
$.ajax({url:url+'/'+id, type: 'PUT', data: {content:content}, success:self.update});
29+
$.ajax({url: url + '/' + id, type: 'PUT', data: {content: content}, success: self.update});
3030
}
3131
};
3232
self.delete = function() {
3333
var li = $(this).parent('li');
3434
var id = li.find('span.id').text();
35-
if (confirm("Deleting #"+id+". Continue?")) {
36-
$.ajax({url:url+'/'+id, type: 'DELETE', success:self.update});
35+
if (confirm("Deleting #" + id + ". Continue?")) {
36+
$.ajax({url: url + '/' + id, type: 'DELETE', success: self.update});
3737
}
3838
};
3939
self.submit = function(e) {
4040
e.preventDefault();
4141
var content = $(this).find('input[name="content"]').val();
42-
$.post(url, {user_id:1,category_id:1,content:content}, self.update);
42+
$.post(url, {user_id: 1, category_id: 1, content: content}, self.update);
4343
};
4444
self.render = function(data) {
4545
data = php_crud_api_transform(data);
@@ -58,17 +58,20 @@
5858
$.get(url, self.render);
5959
};
6060
self.post = function() {
61-
$.post(url, {user_id:1,category_id:1,content:"from zepto"}, self.update);
61+
$.post(url, {user_id: 1, category_id: 1, content: "from zepto"}, self.update);
6262
};
63-
element.on('submit','form',self.submit);
64-
element.on('click','a.edit',self.edit)
65-
element.on('click','a.delete',self.delete)
63+
element.on('submit', 'form', self.submit);
64+
element.on('click', 'a.edit', self.edit);
65+
element.on('click', 'a.delete', self.delete);
6666
self.post();
6767
};
68-
$(function(){ new PostList($('#PostListDiv'),$('#PostListTemplate')); });
68+
$(function(){
69+
new PostList($('#PostListDiv'), $('#PostListTemplate'));
70+
});
6971
</script>
7072
</head>
7173
<body>
7274
<div id="PostListDiv">Loading...</div>
7375
</body>
7476
</html>
77+

0 commit comments

Comments
 (0)