The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Javascript Code
Posted by: Scott | April 13, 2011 @ 12:53pm
Javascript Code
[
Download
]
setLoginInterstitial: function() { // win; var button = Ext.get('login-btn'); var tabs = new Ext.TabPanel({ applyTo: 'hello-tabs', autoTabs:true, activeTab:0, deferredRender:false, border:false }); button.on('click', function(){ // create the window on the first click and reuse on subsequent clicks if(!this.win){ this.win = new Ext.Window({ layout:'fit', width:500, height:300, closeAction:'hide', plain: true, items: tabs, buttons: [{ text:'Submit', disabled:true },{ text: 'Close', handler: function(){ this.win.hide(); } }] }); } // win.addListener('tabchange'); this.win.show(this); tabs.on( 'tabchange', // this.getConnection, function(panel, tab) { console.log("EVENT WORKED IFNE"); this.getConnection(panel, tab); }, this ); }); }, getConnection: function(panel, tab) { console.log("HERE"); var login_click = Ext.fly(tab.title + '_connect'); login_click.on( "click", function() { this.win.hide(); Ext.IframeWindow = Ext.extend(Ext.Window, { onRender: function() { this.bodyCfg = { tag: 'iframe', src: this.src, cls: this.bodyCls, style: { border: '0px none' } }; Ext.IframeWindow.superclass.onRender.apply(this, arguments); } }); var w = new Ext.IframeWindow({ id:id, width:640, height:480, title:"Login via", src:"/users/login/facebook" }) w.show(); }, this ); }
Syntax Highlighting
[
Open in new window
]
Author Comments
The tabchange event seems to lose scope. I get "this.getConnection is not a function
[Break On This Error] this.getConnection(panel, tab); "
Rating
4.51 / 8
39 Votes
http://codebin.yi.org/1223
page generated in 0.01 seconds