Created
February 5, 2013 11:33
-
-
Save fbuchinger/4713886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
var logger = IG.console.getLogger("init"); | |
IG.widgets.init(); | |
IG.switchedToDefaultTab = false; | |
logger.debug("Setting validators"); | |
$.validator.setDefaults(IG.config.validationOptions || {}); | |
if (IG.config.tabContainer && IG.config.renderTabs) { | |
IG.IERoundedTabs(IG.config.tabContainer); | |
} | |
if (IG.isModalForm()) {} | |
logger.debug("Initializing form elements"); | |
$('.ig-form').each(function () { | |
var igFormId = '#' + $(this).attr('id'); | |
IG.forms.push(IGForm(igFormId)); | |
}); | |
if (IG.forms[0] !== undefined) { | |
IG.form = IG.forms[0]; | |
} | |
if (IG.list && $(".overview-list").length > 0) { | |
IG.list.init(); | |
IG.events.trigger("onListReady"); | |
} | |
IG.util.prefixValidatorMessages(); | |
$(document).ajaxError(IG._handleAjaxError); | |
$(document).ajaxSend(IG._handleAjaxSend); | |
if (document.getElementById("IG_container_forms")) document.getElementById("IG_container_forms").style.display = "block"; | |
IG.util.triggerGridReload(); | |
IG.util.preserveActiveTab(); | |
logger.debug("Triggered onFormReady"); | |
logger.debug("onFormready listeners", IG.events._onFormReady); | |
IG.events.trigger("onFormReady"); | |
if (IG.isModalForm()) { | |
var url = IG.util.parseUrl(location.href); | |
var formsizeClass = url.queryParams.bodyClass || 'medium-height'; | |
$('body').addClass('modal-form ' + formsizeClass); | |
parent.IG.events.trigger("onModalFormReady"); | |
} | |
if (IG.tabSettings.defaultTab != null && IG.form.gotoTab) { | |
logger.debug("Changing to default tab", IG.tabSettings.defaultTab); | |
IG.form.gotoTab(IG.tabSettings.defaultTab); | |
} | |
IG.switchedToDefaultTab = true; | |
$.unblockUI(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment