examples/bootstrap/modal.js
[roojs1] / examples / bootstrap / modal.js
1 /* 
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5
6
7
8 Roo.example = Roo.example || {};
9
10 Roo.example.modal = new Roo.XComponent({
11     part     :  ["layout","modal"],
12     order    : '001-modal',
13     region   : '',
14     parent   : '#bootstrap',
15     name     : "unnamed module",
16     disabled : false, 
17     permname : '', 
18     _tree : function()
19     {
20         this.parent = {
21             el : new Roo.bootstrap.Body()
22         }
23         this.parent.el.layout = false;
24         this.parent.el.render(document.body);
25         
26         var _this = this;
27         var MODULE = this;
28         var baseURL = '/web.eventmanager/admin.php';
29         
30         return {
31             xtype: 'Modal',
32             xns: Roo.bootstrap,
33             title : "Login",
34             buttons : Roo.bootstrap.Modal.OKCANCEL,
35             listeners : {
36                 btnclick : function (name, e) {
37                     if(name == 'cancel'){
38                         _this.loginModal.hide();
39                     }
40                     
41                     Roo.log(name);
42                 },
43                 render : function (_self) {
44                     _this.loginModal = _self;
45                 }
46             },
47             items : [
48                 {
49                     xtype: 'Container',
50                     xns: Roo.bootstrap,
51                     html : '<a href="https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=75o3wpchutc38g&state=edward.roojs&redirect_uri=http://localhost/web.eventmanager/demo.local.php" target="_blank"><img src="http://www.lifestylecareers.com.au/plugins/p10_mi_loginpanel/log-in-linkedin-small.png"/></a>'
52                 },
53                 {
54                     xtype: 'Container',
55                     xns: Roo.bootstrap,
56                     well : 'md',
57                     style : 'margin-top:20px',
58                     items : [
59                         {
60                             xtype: 'Form',
61                             xns: Roo.bootstrap,
62                             listeners : {
63                                 actioncomplete : function (_self, action) {
64                                     if (action.type =='submit') {
65                                         _this.loginModal.hide();
66                                     }
67                                 }
68                             },
69                             items : [
70                                 {
71                                     xtype: 'Input',
72                                     xns: Roo.bootstrap,
73                                     fieldLabel : 'Email',
74                                     inputType : 'email',
75                                     vtype : 'email'
76                                 },
77                                 {
78                                     xtype: 'Input',
79                                     xns: Roo.bootstrap,
80                                     fieldLabel : 'Password',
81                                     inputType : 'password'
82                                 }
83                             ]
84                         }
85                     ]
86                 }
87             ]
88         };
89     }
90 });