Skip to content

Commit

Permalink
updated htmlform effect to react to depage.magaziner.loaded event
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasjonas committed Feb 26, 2018
1 parent c80e60d commit 012e89e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/js/effect.js
Expand Up @@ -74,6 +74,8 @@
var check = $form.attr('data-jsvalidation');
var autosave = $form.attr('data-jsautosave');

if ($form.data("depage-form-initialized")) return;

// {{{ hide errormessages on click
$form.on('focus', '.error input', function(event) {
$(this).parents('.error').find('.errorMessage').hide();
Expand Down Expand Up @@ -284,6 +286,8 @@
});
}
// }}}

$form.data("depage-form-initialized", true);
}
// }}}
// {{{ setupRichtextEditor()
Expand Down Expand Up @@ -640,6 +644,11 @@
$('.depage-form').each( function() {
setupForm(this);
});
$("body").on("depage.magaziner.loaded", function(e, url, $page) {
$page.find('.depage-form').each( function() {
setupForm(this);
});
});
});
})(jQuery);

Expand Down

0 comments on commit 012e89e

Please sign in to comment.