The internal names of SP_UI_Dialog has changed in on RTM SP2013 on-premises so you should use:
function _maximizeWindow() {
var currentDialog = SP.UI.ModalDialog.get_childDialog();
if (currentDialog != null && !currentDialog.$Q_0) {
currentDialog.$1Y_0();
}
}
ExecuteOrDelayUntilScriptLoaded(_maximizeWindow, 'sp.ui.dialog.js');
On the current Office 365 you should use:
function _maximizeWindow() {
var currentDialog = SP.UI.ModalDialog.get_childDialog();
if (currentDialog != null && !currentDialog.$Q_0) {
currentDialog.$1l_0();
}
}
ExecuteOrDelayUntilScriptLoaded(_maximizeWindow, 'sp.ui.dialog.js');
Here is a guide on how to find the current version:
- Get a nicely formatted version of sp.ui.dialog.js. In IE 11 you can do it like this
- Open the page with the dialog open
- Press F12 to open Developer tools
- Select the debugger (tab with bug no sign)
- Select sp.ui.dialog.js in the folder dropdown
- Turn pretty print on (button with curly braces)
- Search for showMaximized
- Note the member of this which is assigned a value (on current O365 its $1I_0)
- Search for this member
- At some point it's used in an if or conditional expression (on current O365 the line is
this.$1I_0 && this.$1l_0(null);
- The function called is the maximize toggle function. Remember this function
- Search for this function (on current O365 its $1l_0)
- The first check inside the function (on current O365 the line is
if(this.$Q_0) {
) is the check for already maximized. Remember the member used in this check
- Use the member from bullet 8 in the check and call the function from bullet 6.
allowMaximize
? I use standard New item button of SharePoint to open dialog, not customizedshowModalDialog
function.