| Page 1 of 1 | [ 3 posts ] |
|
Code: Global = {}; YUI().use('node', function(Y) { // none of these attributes, methods, or class defs show up in the eclipse outline view var someVar = null; var MyClass = function(cfg) { this.cfg = cfg; this.getDom = function(n){ return Y.Node.getDOMNode(n); }; } Global.MyClass = MyClass; }); When I use the YUI3 coding style, where everything is wrapped inside the anonymous function, none of the classes or attributes inside the anonymous function show up in the Eclipse outline view. (I'm actually using Aptana Studio, but it's based on Eclipse). Typically, I'm trying to build a class that uses YUI3 internally. Is there a fix or workaround for that? Am I using the wrong pattern? Because when my class defs get big, it's a little hard to navigate by scrollbar. Many thanks. |
|
I've started using this pattern to load yui
Code: Global = {}; YUI().use('node', 'my-class', function(Y) { Global.Y = Y var detach = Y.on('domready", function(){ detach.detach(); Global.main(Y); } } Global.main = function(Y){ // javascript startup code } and my JS class in a separate file Code: // module pattern in 'my-class.js' file, loaded by Y.use() (function(){ var Y = Global.Y; // none of these attributes, methods, or class defs show up in the eclipse outline view var someVar = null; var MyClass = function(cfg) { this.cfg = cfg; this.getDom = function(n){ return Y.Node.getDOMNode(n); }; } MyClass.prototype={}; // this line makes class show up in eclipse outline Global.MyClass = MyClass; })(); It works. Now I can see my Classes in eclipse outline view, so it's easier to navigate through my code. But it seems like I'm doing things the hard way. any better patterns out there? |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group