Skip to content

Commit

Permalink
Merge pull request #1904 from PopulateTools/432-js-vocabulary-form
Browse files Browse the repository at this point in the history
432 - Fix vocabulary term forms
  • Loading branch information
Fernando Blat committed Sep 20, 2018
2 parents 6ec5b58 + ff016dc commit f95b65f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
12 changes: 0 additions & 12 deletions app/javascript/admin/modules/application.js
@@ -1,18 +1,6 @@
import { AUTOCOMPLETE_DEFAULTS, SimpleMDE, Turbolinks } from 'shared'

$(document).on('turbolinks:load', function() {
$('.open_remote_modal').magnificPopup({
type: 'ajax',
removalDelay: 300,
mainClass: 'mfp-fade',
callbacks: {
ajaxContentAdded: function() {
window.GobiertoAdmin.process_stages_controller.form();
window.GobiertoAdmin.globalized_forms_component.handleGlobalizedForm();
}
}
});

$(".stick_in_parent").stick_in_parent();

addDatepickerBehaviors();
Expand Down
22 changes: 14 additions & 8 deletions app/javascript/shared/modules/globals.js
Expand Up @@ -15,13 +15,25 @@ $.fn.extend({
}
});

$(document).on("ajax:complete ajaxSuccess", function() {
$(document).on('turbolinks:load ajax:complete ajaxSuccess', function() {
$('.open_remote_modal').magnificPopup({
type: 'ajax',
removalDelay: 300,
mainClass: 'mfp-fade'
mainClass: 'mfp-fade',
callbacks: {
ajaxContentAdded: function() {
if (window.GobiertoAdmin.process_stages_controller) {
window.GobiertoAdmin.process_stages_controller.form();
}
if (window.GobiertoAdmin.globalized_forms_component) {
window.GobiertoAdmin.globalized_forms_component.handleGlobalizedForm();
}
}
}
});
});

$(document).on('ajax:complete ajaxSuccess', function() {
$('.tipsit').tipsy({fade: false, gravity: 's', html: true});
$('.tipsit-n').tipsy({fade: false, gravity: 'n', html: true});
$('.tipsit-w').tipsy({fade: false, gravity: 'w', html: true});
Expand Down Expand Up @@ -52,12 +64,6 @@ $(document).on('turbolinks:load', function() {
mainClass: 'mfp-fade'
});

$('.open_remote_modal').magnificPopup({
type: 'ajax',
removalDelay: 300,
mainClass: 'mfp-fade'
});

$('.close_modal').click(function() {
$.magnificPopup.close();
});
Expand Down

0 comments on commit f95b65f

Please sign in to comment.