Skip to content

Commit

Permalink
fix(section,question): move the page to the modal window
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Feb 4, 2020
1 parent 9f859d3 commit 0e78cf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,12 @@ function buildTiles(list) {
});
};

this.plugin_formcreator_scrollToModal = function (modalWindow) {
$('html, body').animate({
scrollTop: $(modalWindow).closest('.ui-dialog').offset().top
}, 300);
}

this.addQuestion = function () {
var form = $('form[data-itemtype="PluginFormcreatorQuestion"]');
$.ajax({
Expand Down Expand Up @@ -843,6 +849,7 @@ function buildTiles(list) {
question_id: questionId,
plugin_formcreator_sections_id: sectionId
}).dialog('open');
this.plugin_formcreator_scrollToModal($(modalWindow));
};

this.duplicateSection = function (item) {
Expand Down Expand Up @@ -873,6 +880,7 @@ function buildTiles(list) {
plugin_formcreator_forms_id: formId
}
).dialog('open');
this.plugin_formcreator_scrollToModal($(modalWindow));
}

this.addSection = function () {
Expand Down

0 comments on commit 0e78cf6

Please sign in to comment.