1. setLoginInterstitial: function() {
  2. // win;
  3. var button = Ext.get('login-btn');
  4. var tabs = new Ext.TabPanel({
  5. applyTo: 'hello-tabs',
  6. autoTabs:true,
  7. activeTab:0,
  8. deferredRender:false,
  9. border:false
  10. });
  11.  
  12. button.on('click', function(){
  13.  
  14. // create the window on the first click and reuse on subsequent clicks
  15. if(!this.win){
  16. this.win = new Ext.Window({
  17. layout:'fit',
  18. width:500,
  19. height:300,
  20. closeAction:'hide',
  21. plain: true,
  22. items: tabs,
  23. buttons: [{
  24. text:'Submit',
  25. disabled:true
  26. },{
  27. text: 'Close',
  28. handler: function(){
  29. this.win.hide();
  30. }
  31. }]
  32. });
  33. }
  34. // win.addListener('tabchange');
  35. this.win.show(this);
  36. tabs.on(
  37. 'tabchange',
  38. // this.getConnection,
  39. function(panel, tab) {
  40. console.log("EVENT WORKED IFNE");
  41. this.getConnection(panel, tab);
  42. },
  43. this
  44. );
  45. });
  46. },
  47.  
  48. getConnection: function(panel, tab) {
  49. console.log("HERE");
  50. var login_click = Ext.fly(tab.title + '_connect');
  51. login_click.on(
  52. "click",
  53. function() {
  54. this.win.hide();
  55. Ext.IframeWindow = Ext.extend(Ext.Window, {
  56. onRender: function() {
  57. this.bodyCfg = {
  58. tag: 'iframe',
  59. src: this.src,
  60. cls: this.bodyCls,
  61. style: {
  62. border: '0px none'
  63. }
  64. };
  65. Ext.IframeWindow.superclass.onRender.apply(this, arguments);
  66. }
  67. });
  68.  
  69. var w = new Ext.IframeWindow({
  70. id:id,
  71. width:640,
  72. height:480,
  73. title:"Login via",
  74. src:"/users/login/facebook"
  75. })
  76.  
  77. w.show();
  78.  
  79. },
  80. this
  81. );
  82. }