forked from stefankendall/AppTemplate
-
Notifications
You must be signed in to change notification settings - Fork 18
/
App.js
58 lines (54 loc) · 1.44 KB
/
App.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
51
52
53
54
55
56
57
58
Ext.define('CustomApp', {
extend: 'Rally.app.App',
require: [
'Ext.state.Manager',
'Ext.state.LocalStorageProvider',
'Ext.state.CookieProvider',
'changeset.data.github.Adapter',
'changeset.ui.ChangesetBrowser'
],
componentCls: 'app',
layout: {
type: 'vbox',
align: 'stretch'
},
launch: function() {
var provider;
try {
provider = Ext.create('Ext.state.LocalStorageProvider');
} catch (e) {
provider = Ext.create('Ext.state.CookieProvider');
}
Ext.state.Manager.setProvider(provider);
this.adapter = Ext.create('changeset.data.github.Adapter', {
listeners: {
ready: this._onAdapterReady,
authenticationrequired: this._onAuthenticationRequired,
scope: this
}
});
},
_onAdapterReady: function(adapter) {
this.removeAll();
this.add({
xtype: 'changesetbrowser',
margin: 2,
border: 0,
adapter: adapter,
flex: 1
});
},
_onAuthenticationRequired: function(adapter) {
this.removeAll();
this.add({
flex: 1,
border: 0,
adapter: adapter,
items: [{
xtype: 'changesetlogin',
border: 0,
adapter: adapter
}]
});
}
});