Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update widget page to describe correct getter function #456

Closed
wants to merge 1 commit into from

2 participants

@thcipriani

Previously page described use of option method as:

var bar = $( "<div />")
    .appendTo( "body" )
    .progressbar()
    .data( "progressbar" );

bar.option( "value"); // Setter

This correction describes the usage of the option method as:

var bar = $( "<div />")
    .appendTo( "body" )
    .progressbar()
    .data( "progressbar" );

bar.option( "value"); // Getter
@scottgonzalez

Thanks, can you please sign our CLA?

@scottgonzalez

Thanks. It's being deployed right now.

@arthurvr arthurvr referenced this pull request from a commit in arthurvr/learn.jquery.com
@thcipriani thcipriani Widget Factory: Fix typo (setter -> getter)
Closes gh-456
b86bdf0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  page/plugins/stateful-plugins-with-widget-factory.md
View
2  page/plugins/stateful-plugins-with-widget-factory.md
@@ -140,7 +140,7 @@ alert( bar.progressbar( "value" ) );
### Working with Widget Options
-One of the methods that is automatically available to our plugin is the option method. The option method allows you to get and set options after initialization. This method works exactly like jQuery's `.css()` and `.attr()` methods: you can pass just a name to use it as a setter, a name and value to use it as a single setter, or a hash of name/value pairs to set multiple values. When used as a getter, the plugin will return the current value of the option that corresponds to the name that was passed in. When used as a setter, the plugin's `_setOption` method will be called for each option that is being set. We can specify a `_setOption` method in our plugin to react to option changes.
+One of the methods that is automatically available to our plugin is the option method. The option method allows you to get and set options after initialization. This method works exactly like jQuery's `.css()` and `.attr()` methods: you can pass just a name to use it as a getter, a name and value to use it as a single setter, or a hash of name/value pairs to set multiple values. When used as a getter, the plugin will return the current value of the option that corresponds to the name that was passed in. When used as a setter, the plugin's `_setOption` method will be called for each option that is being set. We can specify a `_setOption` method in our plugin to react to option changes.
Responding when an option is set:
Something went wrong with that request. Please try again.