Merge branch 'mdl-56831-master' of https://github.com/Dagefoerde/moodle

This commit is contained in:
Dan Poltawski 2016-11-14 13:21:35 +00:00
commit 585ba846da
2 changed files with 11 additions and 9 deletions

View file

@ -1 +1 @@
define(["jquery","core/yui"],function(a,b){var c={confirmDialogue:null,init:function(a,d,e,f){var g=a;b.use("moodle-core-notification","moodle-core-formchangechecker","io-form",function(){b.one(e)&&(c.confirmDialogue=new M.core.dialogue({headerContent:d,bodyContent:b.one(e),draggable:!0,visible:!1,center:!0,modal:!0,width:null,extraClasses:["mod_quiz_preflight_popup"]}),b.one(a).on("click",c.displayDialogue),b.one("#id_cancel").on("click",c.hideDialogue),g=c.confirmDialogue.get("boundingBox").one('[name="submitbutton"]')),f&&b.one(g).on("click",c.launchQuizPopup,c,f)})},displayDialogue:function(a){a&&a.halt(),c.confirmDialogue.show()},hideDialogue:function(a){a&&a.halt(),c.confirmDialogue.hide(a)},launchQuizPopup:function(a,c){a.halt(),M.core_formchangechecker.reset_form_dirty_state();var d=a.target.ancestor("form");window.openpopup(a,{url:d.get("action")+"?"+b.IO.stringify(d).replace(/\bcancel=/,"x="),windowname:"quizpopup",options:c,fullscreen:!0})}};return c}); define(["jquery","core/yui"],function(a,b){var c={confirmDialogue:null,init:function(a,d,e,f){var g=a;b.use("moodle-core-notification",function(){b.one(e)&&(c.confirmDialogue=new M.core.dialogue({headerContent:d,bodyContent:b.one(e),draggable:!0,visible:!1,center:!0,modal:!0,width:null,extraClasses:["mod_quiz_preflight_popup"]}),b.one(a).on("click",c.displayDialogue),b.one("#id_cancel").on("click",c.hideDialogue),g=c.confirmDialogue.get("boundingBox").one('[name="submitbutton"]')),f&&b.one(g).on("click",c.launchQuizPopup,c,f)})},displayDialogue:function(a){a&&a.halt(),c.confirmDialogue.show()},hideDialogue:function(a){a&&a.halt(),c.confirmDialogue.hide(a)},launchQuizPopup:function(a,c){a.halt(),b.use("moodle-core-formchangechecker","io-form",function(){M.core_formchangechecker.reset_form_dirty_state();var d=a.target.ancestor("form");window.openpopup(a,{url:d.get("action")+"?"+b.IO.stringify(d).replace(/\bcancel=/,"x="),windowname:"quizpopup",options:c,fullscreen:!0})})}};return c});

View file

@ -45,7 +45,7 @@ define(['jquery', 'core/yui'], function($, Y) {
init: function(startButton, confirmationTitle, confirmationForm, popupoptions) { init: function(startButton, confirmationTitle, confirmationForm, popupoptions) {
var finalStartButton = startButton; var finalStartButton = startButton;
Y.use('moodle-core-notification', 'moodle-core-formchangechecker', 'io-form', function() { Y.use('moodle-core-notification', function() {
if (Y.one(confirmationForm)) { if (Y.one(confirmationForm)) {
t.confirmDialogue = new M.core.dialogue({ t.confirmDialogue = new M.core.dialogue({
headerContent: confirmationTitle, headerContent: confirmationTitle,
@ -99,6 +99,7 @@ define(['jquery', 'core/yui'], function($, Y) {
*/ */
launchQuizPopup: function(e, popupoptions) { launchQuizPopup: function(e, popupoptions) {
e.halt(); e.halt();
Y.use('moodle-core-formchangechecker', 'io-form', function() {
M.core_formchangechecker.reset_form_dirty_state(); M.core_formchangechecker.reset_form_dirty_state();
var form = e.target.ancestor('form'); var form = e.target.ancestor('form');
window.openpopup(e, { window.openpopup(e, {
@ -107,6 +108,7 @@ define(['jquery', 'core/yui'], function($, Y) {
options: popupoptions, options: popupoptions,
fullscreen: true, fullscreen: true,
}); });
});
} }
}; };