Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of general jQueryUI Plugins #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
17 changes: 14 additions & 3 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ JQ.Widget = Em.Mixin.create({

// Create a new instance of the jQuery UI widget based on its `uiType`
// and the current element.
var ui = jQuery.ui[this.get('uiType')](options, this.get('element'));


var namespace = this.get('uiNamespace') || 'ui'; //the included jQuery UI widgets use the 'ui' namespace, ohter jQuery UI plugins may (or rather should) use their own namespace
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like this variable is ever used. Is there something missing?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.
var ui = jQuery(this.get('element')).data(namespace+"-"+this.get('uiType')) ;//save instance
..."namespace"+"-" in that line


jQuery(this.get('element'))[this.get('uiType')](options); //create widget
var ui = jQuery(this.get('element')).data("ui-"+this.get('uiType')) ;//save instance


// Save off the instance of the jQuery UI widget as the `ui` property
// on this Ember view.
this.set('ui', ui);
Expand All @@ -38,7 +43,10 @@ JQ.Widget = Em.Mixin.create({
this.removeObserver(prop, observers[prop]);
}
}
ui._destroy();


//ui._destroy(); this is private, so we better use
ui.destroy();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

},

Expand Down Expand Up @@ -188,6 +196,9 @@ App.ProgressBarView = JQ.ProgressBarView.extend({
// list of people. Because our template binds the JQ.MenuView to this
// value, it will automatically populate with the new people and
// refresh the menu.

console.log("epic stuff happened");

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. sorry.

this.set('controller.people', [
Em.Object.create({
name: "Tom DAAAAALE"
Expand Down