Merge branch 'MDL-70352-MOODLE_310_STABLE' of https://github.com/dmitriim/moodle into MOODLE_310_STABLE
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
define ("core/modal_backdrop",["jquery","core/templates","core/notification","core/fullscreen"],function(a,b,c,d){var e={ROOT:"[data-region=\"modal-backdrop\"]"},f=function(b){this.root=a(b);this.isAttached=!1;if(!this.root.is(e.ROOT)){c.exception({message:"Element is not a modal backdrop"})}};f.prototype.getRoot=function(){return this.root};f.prototype.getAttachmentPoint=function(){return a(d.getElement()||document.body)};f.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}this.isAttached=!0};f.prototype.setZIndex=function(a){this.root.css("z-index",a)};f.prototype.isVisible=function(){return this.root.hasClass("show")};f.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};f.prototype.show=function(){if(this.isVisible()){return}this.attachToDOM();this.root.removeClass("hide").addClass("show")};f.prototype.hide=function(){if(!this.isVisible()){return}if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}};f.prototype.destroy=function(){this.root.remove()};return f});
|
||||
define ("core/modal_backdrop",["jquery","core/templates","core/notification","core/fullscreen"],function(a,b,c,d){var e={ROOT:"[data-region=\"modal-backdrop\"]"},f=function(b){this.root=a(b);this.isAttached=!1;this.attachmentPoint=document.createElement("div");document.body.append(this.attachmentPoint);if(!this.root.is(e.ROOT)){c.exception({message:"Element is not a modal backdrop"})}};f.prototype.getRoot=function(){return this.root};f.prototype.getAttachmentPoint=function(){return a(d.getElement()||this.attachmentPoint)};f.prototype.attachToDOM=function(){this.getAttachmentPoint().append(this.root);if(this.isAttached){return}this.isAttached=!0};f.prototype.setZIndex=function(a){this.root.css("z-index",a)};f.prototype.isVisible=function(){return this.root.hasClass("show")};f.prototype.hasTransitions=function(){return this.getRoot().hasClass("fade")};f.prototype.show=function(){if(this.isVisible()){return}this.attachToDOM();this.root.removeClass("hide").addClass("show")};f.prototype.hide=function(){if(!this.isVisible()){return}if(this.hasTransitions()){this.getRoot().one("transitionend webkitTransitionEnd oTransitionEnd",function(){this.getRoot().removeClass("show").addClass("hide")}.bind(this))}else{this.getRoot().removeClass("show").addClass("hide")}if(a(document.body).find(this.getRoot()).length){a(document.body).append(this.getRoot())}};f.prototype.destroy=function(){this.root.remove();this.attachmentPoint.remove()};return f});
|
||||
//# sourceMappingURL=modal_backdrop.min.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -102,6 +102,8 @@ define([
|
||||
this.bodyJS = null;
|
||||
this.footerJS = null;
|
||||
this.modalCount = modalCounter++;
|
||||
this.attachmentPoint = document.createElement('div');
|
||||
document.body.append(this.attachmentPoint);
|
||||
|
||||
if (!this.root.is(SELECTORS.CONTAINER)) {
|
||||
Notification.exception({message: 'Element is not a modal container'});
|
||||
@@ -648,7 +650,7 @@ define([
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
Modal.prototype.getAttachmentPoint = function() {
|
||||
return $(Fullscreen.getElement() || document.body);
|
||||
return $(Fullscreen.getElement() || this.attachmentPoint);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -753,6 +755,7 @@ define([
|
||||
this.hide();
|
||||
this.root.remove();
|
||||
this.root.trigger(ModalEvents.destroyed, this);
|
||||
this.attachmentPoint.remove();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -797,7 +800,11 @@ define([
|
||||
}
|
||||
|
||||
if (e.keyCode == KeyCodes.escape) {
|
||||
this.hide();
|
||||
if (this.removeOnClose) {
|
||||
this.destroy();
|
||||
} else {
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ define(['jquery', 'core/templates', 'core/notification', 'core/fullscreen'],
|
||||
var ModalBackdrop = function(root) {
|
||||
this.root = $(root);
|
||||
this.isAttached = false;
|
||||
this.attachmentPoint = document.createElement('div');
|
||||
document.body.append(this.attachmentPoint);
|
||||
|
||||
if (!this.root.is(SELECTORS.ROOT)) {
|
||||
Notification.exception({message: 'Element is not a modal backdrop'});
|
||||
@@ -59,7 +61,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/fullscreen'],
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
ModalBackdrop.prototype.getAttachmentPoint = function() {
|
||||
return $(Fullscreen.getElement() || document.body);
|
||||
return $(Fullscreen.getElement() || this.attachmentPoint);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -155,6 +157,7 @@ define(['jquery', 'core/templates', 'core/notification', 'core/fullscreen'],
|
||||
*/
|
||||
ModalBackdrop.prototype.destroy = function() {
|
||||
this.root.remove();
|
||||
this.attachmentPoint.remove();
|
||||
};
|
||||
|
||||
return ModalBackdrop;
|
||||
|
||||
Reference in New Issue
Block a user