Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FOO.Element
- //
- // I have added a check in Object.extends definition that checks if the passed in extending Object has a property called FOO_INIT.
- // So when I say: Object.extend(element,FOO.Element.Element, the FOO_INIT function inside of FOO.Element.Element runs.
- //
- // so I can say $FOO(element) and get an element extended with both $() and FOO.Element.Element.
- // Thats all fine a dandy.
- //
- //
- // This only works with existing DOM nodes.
- // So I created: FOO.A = function(){return $a({class:'FOO_GEN FOO_A'});}
- // That will enable me to say $FOO(FOO.A()); and get back a brand new FOO Element
- //
- // The problem that Im having is with FOO.Element.A
- //
- // What I really need is for the element return from $FOO() to be a class in its own right.
- // That I can either create new ones of or get existing DOM nodes to become them
- // Enough explanation. I will just post this and answer questions if there are any
- if(!FOO) var FOO = {};
- FOO.Element = {};
- FOO.Element.Element = {
- FOO_INIT:function()
- {
- this.CommandStack = new JS.Command.Stack();
- }
- }
- var $FOO = function(element)
- {
- element = $(element);
- if(!element._isFOOElement)
- {
- Object.extend(element,FOO.Element.Element);
- element._isFOOElement = true;
- }
- return element;
- }
- FOO.Element.A = Class.create(FOO.Element.Element,{});
- FOO.A = function(){return $a({class:'FOO_GEN FOO_A'});}
Add Comment
Please, Sign In to add comment