koa-js 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/vendor/assets/javascripts/koa/koa-user.js +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 763b3d4d0f0e1bdab2c56d0044308e3ef0979b23
|
4
|
+
data.tar.gz: 89f003532854ca317d3e215a1015529c1c364b65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3301d702be6f8224b3836c4c8dcb51dffb08c95ac66abba164ff30658306348db1668f288ea8e6b9b10eabdcca416157604aba1395583cb2dfabca72c92df0a7
|
7
|
+
data.tar.gz: 00791e3a904eb15f2822799d66b7f2382fb849b6cf502a51b7b9ff416056422eb04e86499d43c6e08959e11a1398e1eeeed25a46bc5254f2079047ef2955c2b4
|
@@ -66,6 +66,21 @@ var KOAUser = KOAModel.extend({
|
|
66
66
|
},
|
67
67
|
|
68
68
|
instance: {
|
69
|
+
load: function(callback) {
|
70
|
+
if(this.id) {
|
71
|
+
if(callback) return callback(null, this);
|
72
|
+
}
|
73
|
+
var _this = this;
|
74
|
+
API.getUser(this, function(err, user) {
|
75
|
+
if(err) {
|
76
|
+
if(callback) return callback(err);
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
_this.id = user.id;
|
80
|
+
if(callback) callback(null, _this);
|
81
|
+
});
|
82
|
+
},
|
83
|
+
|
69
84
|
getPic: function() {
|
70
85
|
if(!this.pic || this.pic == "null") {
|
71
86
|
return "/img/default-pic.png";
|