1 (function( $, joey, app ) {
6 ui.AbstractWidget = ux.Observable.extend({
8 id: null // the id of the widget
11 el: null, // this is the jquery wrapped dom element(s) that is the root of the widget
15 for(var prop in this) { // automatically bind all the event handlers
16 if(prop.contains("_handler")) {
17 this[prop] = this[prop].bind(this);
22 id: function(suffix) {
23 return this.config.id ? (this.config.id + (suffix ? "-" + suffix : "")) : undefined;
26 attach: function( parent, method ) {
28 this.el[ method || "appendTo"]( parent );
30 this.fire("attached", this );
36 this.fire("removed", this );
37 this.removeAllObservers();
43 joey.plugins.push( function( obj ) {
44 if( obj instanceof ui.AbstractWidget ) {
49 })( this.jQuery, this.joey, this.app );