-
Notifications
You must be signed in to change notification settings - Fork 0
/
nano-mvc.view.js
50 lines (38 loc) · 1.09 KB
/
nano-mvc.view.js
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
45
46
47
48
49
50
(function () {
"use strict";
function View(controller) {
function init(controller) {
var that = this;
controller.subscribe(function () {
that.handle.apply(that, arguments);
});
that.child_init(controller);
}
function handle(controller, event, type) {
// this calls the method matching the msg 'event'
this[event](controller, type);
}
function child_init(controller) {
}
function success(controller, type) {
}
function error(controller, type) {
}
function working(controller, type) {
}
return {
// "private" methods that should not be overridden
init: init,
handle: handle,
// "protected" methods that should always be overridden
child_init: child_init,
success: success,
error: error,
working: working,
};
}
nano = window.nano || {};
$.extend(nano, {
View: View
});
}());