Topic on Talk:OOUI

Getting OOUI object reference from an element?

2
137.147.133.11 (talkcontribs)

For example, I simply want to disable a button. Before I could just set the disabled property, but now I need to call the disable method on the button's OOUI object. If the button was a PHP object, I could infuse it to get the object, but for buttons created in JS (by other scripts I have no control over, for instance), infuse doesn't work.

Matma Rex (talkcontribs)

There is no way to do this. If the other script wanted you to be able to disable its button, it would allow you to get the OOUI object.

For example, the other script could do something like this:

fooWidget.$element.data( 'ooui', fooWidget );

…but if it doesn't, there's no way to get the OOUI object from the DOM element.