jquery ui dialog extended with minimize, restore and maximize buttons

jquery ui dialog extended with minimize, restore and maximize buttons

Hi,

I'm extending the dialog to have more funcionalities but i need to disable resize and drag when it's minimized. I though i could override the method "resize" and "drag" but i can't find how.

I attached the file, but my doubt is:

I have i variable which stores the state of the dialog (eg, if it's minimized or maximized) and i'd like to check it overriding methods for resize and drag, if it isn't minimized, i'd call the default method.

how to disable resize and drag only when it's minimized? 
Any opinion about this override?
is there another way?

Thanks,
Carlos