The jquery-ui dialog widget is wrapped (just like all other widgets) within an anonymous function.
Inside this function there is a variable declared named sizeRelatedOptions
. I need to add a key to that object from outside that wrapping closure. What is the best way to achieve this?
(function( $, undefined ) {
var sizeRelatedOptions = {
buttons: true,
height: true,
//etc
}
$.widget( "ui.dialog", {
//widget code
});
}( jQuery ) );
Edit #1: above code is source code of jQuery ui
Edit #2: I now understand that I can't simply access that variable. So I have to work around this. Therefore, here some more information about why I need this:
I am extending jQuery ui's dialog widget to add another buttonPane. To make the widget resize itself once the pane is added to the widget, I wanted to add an option to sizeRelatedOption
. (That's what this question first was about.) Because the _options
function of the dialog widget checks whether the option exists in sizeRelatedOption
as a key. When that is the case it calls the _size
function which resizes the widget.
Hopefully I made myself a bit clear.