Skip to content
Snippets Groups Projects
Commit dfff8b78 authored by Denys Rul's avatar Denys Rul
Browse files

MAGETWO-32484: Stabilization of changes and bug fixing

- Use registry to make sure that adminSystemConfig is defined
parent 452ca131
No related branches found
No related tags found
No related merge requests found
......@@ -25,27 +25,14 @@
<script>
require([
"jquery",
"Magento_Ui/js/lib/registry/registry",
"jquery/jquery.hashchange",
"mage/mage",
"prototype"
], function(jQuery){
"prototype",
"domReady!"
], function(jQuery, registry){
jQuery(function() {
window.configForm = jQuery('#config-edit-form').mage('form').mage('validation', {
submitHandler: function(form)
{
$$('.requires').each(function(element) {
var scopeElement = adminSystemConfig.getScopeElement(element);
if (!scopeElement || !scopeElement.checked) {
Element.extend(element).disabled = false;
}
});
jQuery(form).trigger('afterValidate');
form.submit();
}
});
window.adminSystemConfig = {
var adminSystemConfig = {
getUp: function (element, tag) {
var $element = Element.extend(element);
if (typeof $element.upTag == 'undefined') {
......@@ -213,6 +200,19 @@ require([
}
};
window.configForm = jQuery('#config-edit-form').mage('form').mage('validation', {
submitHandler: function(form)
{
$$('.requires').each(function(element) {
var scopeElement = adminSystemConfig.getScopeElement(element);
if (!scopeElement || !scopeElement.checked) {
Element.extend(element).disabled = false;
}
});
jQuery(form).trigger('afterValidate');
form.submit();
}
});
$$('.shared').each(function(element){
Event.observe(element, 'change', adminSystemConfig.onchangeSharedElement);
......@@ -348,8 +348,6 @@ require([
jQuery(window).hashchange(handleHash);
handleHash();
});
jQuery(window).load(function(){jQuery('body').trigger('adminConfigDefined')})
registry.set('adminSystemConfig', adminSystemConfig);
});
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment