Commit 24a35c38 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Hide more Close button when uneeded

parent 9e5598cc
/**
* @file questionExtraSurvey javascript system
* @author Denis Chenu
* @version 5.4.1
* @version 5.4.5
* @copyright Denis Chenu <http://www.sondages.pro>
* @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
*/
......@@ -79,19 +79,13 @@ $(document).on("hide.bs.modal",'#modal-questionExtraSurvey',function(e) {
/* Unload iframe */
$(document).on("hide.bs.modal",'#modal-questionExtraSurvey',function(e) {
/* Maybe remove ? */
try {
document.getElementById('extra-survey-iframe').contentWindow.closeReloadAnyResponse();
} catch (exception) {
// Nothing to do : reloadAnyReponse are not up to date
}
$("#modal-questionExtraSurvey .frame-loaded").addClass("frame-loading").removeClass("frame-loaded");
$("#modal-questionExtraSurvey .modal-footer .btn").addClass("btn-waiting");
});
$(document).on("hidden.bs.modal",'#modal-questionExtraSurvey',function(e) {
setTimeout(() => {
$("#modal-questionExtraSurvey iframe").attr("src", "");
}, 1500);
$("#modal-questionExtraSurvey .frame-loaded").addClass("frame-loading").removeClass("frame-loaded");
$("#modal-questionExtraSurvey .modal-footer .btn").addClass("btn-waiting");
});
function checkIsEmpty(element, srid) {
......@@ -165,10 +159,10 @@ $(document).on('extrasurveyframe:on',function(event,data) {
$(document).on('extrasurveyframe:off',function(event,data) {
// Review : don't happen
$("#modal-questionExtraSurvey .modal-footer button[data-action]").each(function(){
$(this).prop('disabled',true);
});
$("#modal-questionExtraSurvey .modal-footer button").addClass("btn-waiting");
});
$(document).on('extrasurveyframe:autoclose',function(event,data) {
$("#modal-questionExtraSurvey").modal('hide');
......@@ -195,6 +189,7 @@ $(document).on('click',"#modal-questionExtraSurvey button[data-action='delete']:
$("#modal-questionExtraSurvey iframe").contents().find("#limesurvey").append("<input type='hidden' name='confirm-clearall' value='confirm'>");
$("#modal-questionExtraSurvey iframe").contents().find("#limesurvey").append("<input type='hidden' name='delete' value='delete'>");
$("#modal-questionExtraSurvey iframe").contents().find("#limesurvey").submit();
$("#modal-questionExtraSurvey .modal-footer .btn").addClass("btn-waiting");
});
$("#modal-confirm-clearall-extrasurvey [data-dismiss]").on('click',function(){
// LimeSurve 3.13 have an issue with dialog box not closed …
......@@ -208,5 +203,6 @@ $(document).on('click',"#modal-questionExtraSurvey button[data-action='saveall-q
$("#extra-survey-iframe").contents().find("form#limesurvey").append("<input type='hidden' name='questionExtraSurveyQid' value='"+questionExtraSurveyQid+"'>");
$("#extra-survey-iframe").contents().find("form#limesurvey").append("<input type='hidden' name='autosaveandquit' value=1>");
$("#extra-survey-iframe").contents().find("form#limesurvey button:submit[value='saveall']").last().click();
$("#modal-questionExtraSurvey .modal-footer .btn").addClass("btn-waiting");
return;
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment