diff --git a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-debug.js b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-debug.js index c5b7e404c0f..d79fed4a423 100644 --- a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-debug.js +++ b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-debug.js @@ -57,12 +57,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] return; } - var dialogueHeight = this.get('host').get('boundingBox').get('region').height, - // Most modern browsers use win.innerHeight, but some older versions of IE use documentElement.clientHeight. - // We fall back to 0 if neither can be found which has the effect of disabling scroll locking. - windowHeight = Y.config.win.innerHeight || Y.config.doc.documentElement.clientHeight || 0; - - if (!forceOnSmallWindow && dialogueHeight > (windowHeight - 10)) { + if (!this.shouldLockScroll(forceOnSmallWindow)) { Y.log('Dialogue height greater than window height. Ignoring enable request.', 'warn', 'moodle-core-lockscroll'); return; } @@ -96,6 +91,44 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] return this; }, + /** + * Recalculate whether lock scrolling should be on or off. + * + * @method shouldLockScroll + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @return boolean + */ + shouldLockScroll: function(forceOnSmallWindow) { + var dialogueHeight = this.get('host').get('boundingBox').get('region').height, + // Most modern browsers use win.innerHeight, but some older versions of IE use documentElement.clientHeight. + // We fall back to 0 if neither can be found which has the effect of disabling scroll locking. + windowHeight = Y.config.win.innerHeight || Y.config.doc.documentElement.clientHeight || 0; + + if (!forceOnSmallWindow && dialogueHeight > (windowHeight - 10)) { + return false; + } else { + return true; + } + }, + + /** + * Recalculate whether lock scrolling should be on or off because the size of the dialogue changed. + * + * @method updateScrollLock + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @chainable + */ + updateScrollLock: function(forceOnSmallWindow) { + // Both these functions already check if scroll lock is active and do the right thing. + if (this.shouldLockScroll(forceOnSmallWindow)) { + this.enableScrollLock(forceOnSmallWindow); + } else { + this.disableScrollLock(true); + } + + return this; + }, + /** * Stop locking the page scroll. * @@ -105,7 +138,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] * @method disableScrollLock * @chainable */ - disableScrollLock: function() { + disableScrollLock: function(force) { if (this.isActive()) { Y.log('Disabling LockScroll.', 'debug', 'moodle-core-lockscroll'); this._enabled = false; @@ -117,7 +150,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] var currentCount = parseInt(body.getAttribute('data-activeScrollLocks'), 10) || 1, newCount = currentCount - 1; - if (currentCount === 1) { + if (force || currentCount === 1) { body.removeClass('lockscroll'); body.setStyle('maxWidth', null); } diff --git a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-min.js b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-min.js index 5207360b5d0..e7d7c8ab861 100644 --- a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-min.js +++ b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll-min.js @@ -1 +1 @@ -YUI.add("moodle-core-lockscroll",function(e,t){e.namespace("M.core").LockScroll=e.Base.create("lockScroll",e.Plugin.Base,[],{_enabled:!1,destructor:function(){this.disableScrollLock()},enableScrollLock:function(t){if(this.isActive())return;var n=this.get("host").get("boundingBox").get("region").height,r=e.config.win.innerHeight||e.config.doc.documentElement.clientHeight||0;if(!t&&n>r-10)return;this._enabled=!0;var i=e.one(e.config.doc.body),s=i.getComputedStyle("width");i.addClass("lockscroll");var o=parseInt(i.getAttribute("data-activeScrollLocks"),10)||0,u=o+1;return i.setAttribute("data-activeScrollLocks",u),o===0&&i.setStyle("maxWidth",s),this},disableScrollLock:function(){if(this.isActive()){this._enabled=!1;var t=e.one(e.config.doc.body),n=parseInt(t.getAttribute("data-activeScrollLocks"),10)||1,r=n-1;n===1&&(t.removeClass("lockscroll"),t.setStyle("maxWidth",null)),t.setAttribute("data-activeScrollLocks",n-1)}return this},isActive:function(){return this._enabled}},{NS:"lockScroll",ATTRS:{}})},"@VERSION@",{requires:["plugin","base-build"]}); +YUI.add("moodle-core-lockscroll",function(e,t){e.namespace("M.core").LockScroll=e.Base.create("lockScroll",e.Plugin.Base,[],{_enabled:!1,destructor:function(){this.disableScrollLock()},enableScrollLock:function(t){if(this.isActive())return;if(!this.shouldLockScroll(t))return;this._enabled=!0;var n=e.one(e.config.doc.body),r=n.getComputedStyle("width");n.addClass("lockscroll");var i=parseInt(n.getAttribute("data-activeScrollLocks"),10)||0,s=i+1;return n.setAttribute("data-activeScrollLocks",s),i===0&&n.setStyle("maxWidth",r),this},shouldLockScroll:function(t){var n=this.get("host").get("boundingBox").get("region").height,r=e.config.win.innerHeight||e.config.doc.documentElement.clientHeight||0;return!t&&n>r-10?!1:!0},updateScrollLock:function(e){return this.shouldLockScroll(e)?this.enableScrollLock(e):this.disableScrollLock(!0),this},disableScrollLock:function(t){if(this.isActive()){this._enabled=!1;var n=e.one(e.config.doc.body),r=parseInt(n.getAttribute("data-activeScrollLocks"),10)||1,i=r-1;if(t||r===1)n.removeClass("lockscroll"),n.setStyle("maxWidth",null);n.setAttribute("data-activeScrollLocks",r-1)}return this},isActive:function(){return this._enabled}},{NS:"lockScroll",ATTRS:{}})},"@VERSION@",{requires:["plugin","base-build"]}); diff --git a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll.js b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll.js index c15b74eabc0..e447cd16871 100644 --- a/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll.js +++ b/lib/yui/build/moodle-core-lockscroll/moodle-core-lockscroll.js @@ -56,12 +56,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] return; } - var dialogueHeight = this.get('host').get('boundingBox').get('region').height, - // Most modern browsers use win.innerHeight, but some older versions of IE use documentElement.clientHeight. - // We fall back to 0 if neither can be found which has the effect of disabling scroll locking. - windowHeight = Y.config.win.innerHeight || Y.config.doc.documentElement.clientHeight || 0; - - if (!forceOnSmallWindow && dialogueHeight > (windowHeight - 10)) { + if (!this.shouldLockScroll(forceOnSmallWindow)) { return; } @@ -91,6 +86,44 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] return this; }, + /** + * Recalculate whether lock scrolling should be on or off. + * + * @method shouldLockScroll + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @return boolean + */ + shouldLockScroll: function(forceOnSmallWindow) { + var dialogueHeight = this.get('host').get('boundingBox').get('region').height, + // Most modern browsers use win.innerHeight, but some older versions of IE use documentElement.clientHeight. + // We fall back to 0 if neither can be found which has the effect of disabling scroll locking. + windowHeight = Y.config.win.innerHeight || Y.config.doc.documentElement.clientHeight || 0; + + if (!forceOnSmallWindow && dialogueHeight > (windowHeight - 10)) { + return false; + } else { + return true; + } + }, + + /** + * Recalculate whether lock scrolling should be on or off because the size of the dialogue changed. + * + * @method updateScrollLock + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @chainable + */ + updateScrollLock: function(forceOnSmallWindow) { + // Both these functions already check if scroll lock is active and do the right thing. + if (this.shouldLockScroll(forceOnSmallWindow)) { + this.enableScrollLock(forceOnSmallWindow); + } else { + this.disableScrollLock(true); + } + + return this; + }, + /** * Stop locking the page scroll. * @@ -100,7 +133,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] * @method disableScrollLock * @chainable */ - disableScrollLock: function() { + disableScrollLock: function(force) { if (this.isActive()) { this._enabled = false; @@ -111,7 +144,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] var currentCount = parseInt(body.getAttribute('data-activeScrollLocks'), 10) || 1, newCount = currentCount - 1; - if (currentCount === 1) { + if (force || currentCount === 1) { body.removeClass('lockscroll'); body.setStyle('maxWidth', null); } diff --git a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js index b94fdf9bd92..86f372cba1c 100644 --- a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js +++ b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-debug.js @@ -331,6 +331,11 @@ Y.extend(DIALOGUE, Y.Panel, { 'height' : this.get('height')}); } } + + // Update Lock scroll if the plugin is present. + if (this.lockScroll) { + this.lockScroll.updateScrollLock(this.shouldResizeFullscreen()); + } }, /** * Center the dialog on the screen. @@ -387,13 +392,6 @@ Y.extend(DIALOGUE, Y.Panel, { this.get('boundingBox').setXY(this._originalPosition); } - // Lock scroll if the plugin is present. - if (this.lockScroll) { - // We need to force the scroll locking for full screen dialogues, even if they have a small vertical size to - // prevent the background scrolling while the dialogue is open. - this.lockScroll.enableScrollLock(this.shouldResizeFullscreen()); - } - // Try and find a node to focus on using the focusOnShowSelector attribute. if (focusSelector !== null) { focusNode = this.get('boundingBox').one(focusSelector); diff --git a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js index db5eca8027c..bdbf8f36a79 100644 --- a/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js +++ b/lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-core-notification-dialogue",function(e,t){var n,r,i,s,o,u,a;n="moodle-dialogue",r="notificationBase",i="yesLabel",s="noLabel",o="title",u="question",a={BASE:"moodle-dialogue-base",WRAP:"moodle-dialogue-wrap",HEADER:"moodle-dialogue-hd",BODY:"moodle-dialogue-bd",CONTENT:"moodle-dialogue-content",FOOTER:"moodle-dialogue-ft",HIDDEN:"hidden",LIGHTBOX:"moodle-dialogue-lightbox"},M.core=M.core||{};var f="Moodle dialogue",l,c=n+"-fullscreen",h=n+"-hidden",p=" [role=dialog]",d="[role=menubar]",v=".",m="moodle-has-zindex",g='input:not([type="hidden"]), a[href], button, textarea, select, [tabindex]';l=function(t){var n=e.clone(t);n.COUNT=e.stamp(this);var r="moodle-dialogue-"+n.COUNT;n.notificationBase=e.Node.create('
').append(e.Node.create('').append(e.Node.create('
')).append(e.Node.create('
')).append(e.Node.create('
'))),e.one(document.body).append(n.notificationBase),n.additionalBaseClass&&n.notificationBase.addClass(n.additionalBaseClass),n.srcNode="#"+r,n.closeButton===!1?n.buttons=null:n.buttons=[{section:e.WidgetStdMod.HEADER,classNames:"closebutton",action:function(){this.hide()}}],l.superclass.constructor.apply(this,[n]),n.closeButton!==!1&&this.get("buttons").header[0].setAttribute("title",this.get("closeButtonTitle"))},e.extend(l,e.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!1,_originalPosition:null,_hiddenSiblings:null,initializer:function(){var t;this._hiddenSiblings=[],this.get("render")&&this.render(),this.after("visibleChange",this.visibilityChanged,this),this.get("center")&&this.centerDialogue(),this.get("modal")&&(this.get(r).set("aria-hidden","true"),this.plug(e.M.core.LockScroll)),t=this.get("boundingBox"),t.addClass(m),e.Array.each(this.get("extraClasses"),t.addClass,t),this.get("visible")&&this.applyZIndex(),this.on("maskShow",this.applyZIndex),this.on("maskShow",function(){var t=e.one(e.config.win),n=this.get("boundingBox");this.get("center")||(this._originalPosition=n.getXY()),n.getStyle("position")!=="fixed"&&n.setStyles({top:t.get("scrollTop"),left:t.get("scrollLeft")})},this),this.after("destroyedChange",function(){this.get(r).remove(!0)},this)},applyZIndex:function(){var t=1,n=1,r=this.get("boundingBox"),i=this.get("maskNode"),s=this.get("zIndex");s!==0&&!this._calculatedzindex?r.setStyle("zIndex",s):(e.all(p+", "+d+", "+v+m).each(function(e){var n=this.findZIndex(e);n>t&&(t=n)},this),n=(t+1).toString(),r.setStyle("zIndex",n),this.set("zIndex",n),this.get("modal")&&(i.setStyle("zIndex",n),e.UA.ie&&e.UA.compareVersions(e.UA.ie,9)<0&&setTimeout(function(){i.setStyle("position","static"),setTimeout(function(){i.setStyle("position","fixed")},0)},0)),this._calculatedzindex=!0)},findZIndex:function(e){var t=e.getStyle("zIndex")||e.ancestor().getStyle("zIndex");return t?parseInt(t,10):0},visibilityChanged:function(t){var n,r;t.attrName==="visible"&&(this.get("maskNode").addClass(a.LIGHTBOX),t.prevVal&&!t.newVal&&(r=this.get("boundingBox"),this._resizeevent&&(this._resizeevent.detach(),this._resizeevent=null),this._orientationevent&&(this._orientationevent.detach(),this._orientationevent=null),r.detach("key",this.keyDelegation),this.get("modal")&&this.setAccessibilityHidden()),!t.prevVal&&t.newVal&&(this.applyZIndex(),this.makeResponsive(),this.shouldResizeFullscreen()||this.get("draggable")&&(n="#"+this.get("id")+" ."+a.HEADER,this.plug(e.Plugin.Drag,{handles:[n]}),e.one(n).setStyle("cursor","move")),this.keyDelegation(),this.get("modal")&&this.setAccessibilityVisible()),this.get("center")&&!t.prevVal&&t.newVal&&this.centerDialogue())},makeResponsive:function(){var e=this.get("boundingBox");this.shouldResizeFullscreen()?(e.addClass(c),e.setStyles({left:null,top:null,width:null,height:null,right:null,bottom:null})):this.get("responsive")&&e.removeClass(c).setStyles({width:this.get("width"),height:this.get("height")})},centerDialogue:function(){var t=this.get("boundingBox"),n=t.hasClass(h),r,i;if(this.shouldResizeFullscreen())return;n&&t.setStyle("top","-1000px").removeClass(h),r=Math.max(Math.round((t.get("winWidth")-t.get("offsetWidth"))/2),15),i=Math.max(Math.round((t.get("winHeight")-t.get("offsetHeight"))/2),15)+e.one(window).get("scrollTop"),t.setStyles({left:r,top:i}),n&&t.addClass(h),this.makeResponsive()},shouldResizeFullscreen:function(){return window===window.parent&&this.get("responsive")&&Math.floor(e.one(document.body).get("winWidth"))').append(e.Node.create('').append(e.Node.create('
')).append(e.Node.create('
')).append(e.Node.create('
'))),e.one(document.body).append(n.notificationBase),n.additionalBaseClass&&n.notificationBase.addClass(n.additionalBaseClass),n.srcNode="#"+r,n.closeButton===!1?n.buttons=null:n.buttons=[{section:e.WidgetStdMod.HEADER,classNames:"closebutton",action:function(){this.hide()}}],l.superclass.constructor.apply(this,[n]),n.closeButton!==!1&&this.get("buttons").header[0].setAttribute("title",this.get("closeButtonTitle"))},e.extend(l,e.Panel,{_resizeevent:null,_orientationevent:null,_calculatedzindex:!1,_originalPosition:null,_hiddenSiblings:null,initializer:function(){var t;this._hiddenSiblings=[],this.get("render")&&this.render(),this.after("visibleChange",this.visibilityChanged,this),this.get("center")&&this.centerDialogue(),this.get("modal")&&(this.get(r).set("aria-hidden","true"),this.plug(e.M.core.LockScroll)),t=this.get("boundingBox"),t.addClass(m),e.Array.each(this.get("extraClasses"),t.addClass,t),this.get("visible")&&this.applyZIndex(),this.on("maskShow",this.applyZIndex),this.on("maskShow",function(){var t=e.one(e.config.win),n=this.get("boundingBox");this.get("center")||(this._originalPosition=n.getXY()),n.getStyle("position")!=="fixed"&&n.setStyles({top:t.get("scrollTop"),left:t.get("scrollLeft")})},this),this.after("destroyedChange",function(){this.get(r).remove(!0)},this)},applyZIndex:function(){var t=1,n=1,r=this.get("boundingBox"),i=this.get("maskNode"),s=this.get("zIndex");s!==0&&!this._calculatedzindex?r.setStyle("zIndex",s):(e.all(p+", "+d+", "+v+m).each(function(e){var n=this.findZIndex(e);n>t&&(t=n)},this),n=(t+1).toString(),r.setStyle("zIndex",n),this.set("zIndex",n),this.get("modal")&&(i.setStyle("zIndex",n),e.UA.ie&&e.UA.compareVersions(e.UA.ie,9)<0&&setTimeout(function(){i.setStyle("position","static"),setTimeout(function(){i.setStyle("position","fixed")},0)},0)),this._calculatedzindex=!0)},findZIndex:function(e){var t=e.getStyle("zIndex")||e.ancestor().getStyle("zIndex");return t?parseInt(t,10):0},visibilityChanged:function(t){var n,r;t.attrName==="visible"&&(this.get("maskNode").addClass(a.LIGHTBOX),t.prevVal&&!t.newVal&&(r=this.get("boundingBox"),this._resizeevent&&(this._resizeevent.detach(),this._resizeevent=null),this._orientationevent&&(this._orientationevent.detach(),this._orientationevent=null),r.detach("key",this.keyDelegation),this.get("modal")&&this.setAccessibilityHidden()),!t.prevVal&&t.newVal&&(this.applyZIndex(),this.makeResponsive(),this.shouldResizeFullscreen()||this.get("draggable")&&(n="#"+this.get("id")+" ."+a.HEADER,this.plug(e.Plugin.Drag,{handles:[n]}),e.one(n).setStyle("cursor","move")),this.keyDelegation(),this.get("modal")&&this.setAccessibilityVisible()),this.get("center")&&!t.prevVal&&t.newVal&&this.centerDialogue())},makeResponsive:function(){var e=this.get("boundingBox");this.shouldResizeFullscreen()?(e.addClass(c),e.setStyles({left:null,top:null,width:null,height:null,right:null,bottom:null})):this.get("responsive")&&e.removeClass(c).setStyles({width:this.get("width"),height:this.get("height")}),this.lockScroll&&this.lockScroll.updateScrollLock(this.shouldResizeFullscreen())},centerDialogue:function(){var t=this.get("boundingBox"),n=t.hasClass(h),r,i;if(this.shouldResizeFullscreen())return;n&&t.setStyle("top","-1000px").removeClass(h),r=Math.max(Math.round((t.get("winWidth")-t.get("offsetWidth"))/2),15),i=Math.max(Math.round((t.get("winHeight")-t.get("offsetHeight"))/2),15)+e.one(window).get("scrollTop"),t.setStyles({left:r,top:i}),n&&t.addClass(h),this.makeResponsive()},shouldResizeFullscreen:function(){return window===window.parent&&this.get("responsive")&&Math.floor(e.one(document.body).get("winWidth")) (windowHeight - 10)) { + if (!this.shouldLockScroll(forceOnSmallWindow)) { Y.log('Dialogue height greater than window height. Ignoring enable request.', 'warn', 'moodle-core-lockscroll'); return; } @@ -94,6 +89,44 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] return this; }, + /** + * Recalculate whether lock scrolling should be on or off. + * + * @method shouldLockScroll + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @return boolean + */ + shouldLockScroll: function(forceOnSmallWindow) { + var dialogueHeight = this.get('host').get('boundingBox').get('region').height, + // Most modern browsers use win.innerHeight, but some older versions of IE use documentElement.clientHeight. + // We fall back to 0 if neither can be found which has the effect of disabling scroll locking. + windowHeight = Y.config.win.innerHeight || Y.config.doc.documentElement.clientHeight || 0; + + if (!forceOnSmallWindow && dialogueHeight > (windowHeight - 10)) { + return false; + } else { + return true; + } + }, + + /** + * Recalculate whether lock scrolling should be on or off because the size of the dialogue changed. + * + * @method updateScrollLock + * @param {Boolean} forceOnSmallWindow Whether to enable the scroll lock, even for small window sizes. + * @chainable + */ + updateScrollLock: function(forceOnSmallWindow) { + // Both these functions already check if scroll lock is active and do the right thing. + if (this.shouldLockScroll(forceOnSmallWindow)) { + this.enableScrollLock(forceOnSmallWindow); + } else { + this.disableScrollLock(true); + } + + return this; + }, + /** * Stop locking the page scroll. * @@ -103,7 +136,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] * @method disableScrollLock * @chainable */ - disableScrollLock: function() { + disableScrollLock: function(force) { if (this.isActive()) { Y.log('Disabling LockScroll.', 'debug', 'moodle-core-lockscroll'); this._enabled = false; @@ -115,7 +148,7 @@ Y.namespace('M.core').LockScroll = Y.Base.create('lockScroll', Y.Plugin.Base, [] var currentCount = parseInt(body.getAttribute('data-activeScrollLocks'), 10) || 1, newCount = currentCount - 1; - if (currentCount === 1) { + if (force || currentCount === 1) { body.removeClass('lockscroll'); body.setStyle('maxWidth', null); } diff --git a/lib/yui/src/notification/js/dialogue.js b/lib/yui/src/notification/js/dialogue.js index c1cbbf0bd27..8f0220c7d2d 100644 --- a/lib/yui/src/notification/js/dialogue.js +++ b/lib/yui/src/notification/js/dialogue.js @@ -302,6 +302,11 @@ Y.extend(DIALOGUE, Y.Panel, { 'height' : this.get('height')}); } } + + // Update Lock scroll if the plugin is present. + if (this.lockScroll) { + this.lockScroll.updateScrollLock(this.shouldResizeFullscreen()); + } }, /** * Center the dialog on the screen. @@ -358,13 +363,6 @@ Y.extend(DIALOGUE, Y.Panel, { this.get('boundingBox').setXY(this._originalPosition); } - // Lock scroll if the plugin is present. - if (this.lockScroll) { - // We need to force the scroll locking for full screen dialogues, even if they have a small vertical size to - // prevent the background scrolling while the dialogue is open. - this.lockScroll.enableScrollLock(this.shouldResizeFullscreen()); - } - // Try and find a node to focus on using the focusOnShowSelector attribute. if (focusSelector !== null) { focusNode = this.get('boundingBox').one(focusSelector);