Merge branch 'MDL-47734-master-fixes' of git://github.com/andrewnicols/moodle

This commit is contained in:
Dan Poltawski 2014-10-27 07:40:06 +00:00
commit a1ac634692
4 changed files with 32 additions and 32 deletions

View File

@ -119,7 +119,6 @@ Y.extend(DIALOGUE, Y.Panel, {
if (this.get('render')) {
this.render();
}
this.makeResponsive();
this.after('visibleChange', this.visibilityChanged, this);
if (this.get('center')) {
this.centerDialogue();
@ -152,10 +151,14 @@ Y.extend(DIALOGUE, Y.Panel, {
if (!this.get('center')) {
this._originalPosition = bb.getXY();
}
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
if (bb.getStyle('position') !== 'fixed') {
// If the boundingBox has been positioned in a fixed manner, then it will not position correctly to scrollTop.
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
}
}, this);
// Remove the dialogue from the DOM when it is destroyed.
@ -274,8 +277,7 @@ Y.extend(DIALOGUE, Y.Panel, {
* @method makeResponsive
*/
makeResponsive : function() {
var bb = this.get('boundingBox'),
content;
var bb = this.get('boundingBox');
if (this.shouldResizeFullscreen()) {
// Make this dialogue fullscreen on a small screen.
@ -290,15 +292,12 @@ Y.extend(DIALOGUE, Y.Panel, {
'height' : null,
'right' : null,
'bottom' : null});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
} else {
if (this.get('responsive')) {
// We must reset any of the fullscreen changes.
bb.removeClass(DIALOGUE_FULLSCREEN_CLASS)
.setStyles({'width' : this.get('width'),
'height' : this.get('height')});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
}
}
},
@ -327,6 +326,7 @@ Y.extend(DIALOGUE, Y.Panel, {
if (hidden) {
bb.addClass(DIALOGUE_HIDDEN_CLASS);
}
this.makeResponsive();
},
/**
* Return whether this dialogue should be fullscreen or not.

File diff suppressed because one or more lines are too long

View File

@ -119,7 +119,6 @@ Y.extend(DIALOGUE, Y.Panel, {
if (this.get('render')) {
this.render();
}
this.makeResponsive();
this.after('visibleChange', this.visibilityChanged, this);
if (this.get('center')) {
this.centerDialogue();
@ -152,10 +151,14 @@ Y.extend(DIALOGUE, Y.Panel, {
if (!this.get('center')) {
this._originalPosition = bb.getXY();
}
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
if (bb.getStyle('position') !== 'fixed') {
// If the boundingBox has been positioned in a fixed manner, then it will not position correctly to scrollTop.
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
}
}, this);
// Remove the dialogue from the DOM when it is destroyed.
@ -274,8 +277,7 @@ Y.extend(DIALOGUE, Y.Panel, {
* @method makeResponsive
*/
makeResponsive : function() {
var bb = this.get('boundingBox'),
content;
var bb = this.get('boundingBox');
if (this.shouldResizeFullscreen()) {
// Make this dialogue fullscreen on a small screen.
@ -290,15 +292,12 @@ Y.extend(DIALOGUE, Y.Panel, {
'height' : null,
'right' : null,
'bottom' : null});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
} else {
if (this.get('responsive')) {
// We must reset any of the fullscreen changes.
bb.removeClass(DIALOGUE_FULLSCREEN_CLASS)
.setStyles({'width' : this.get('width'),
'height' : this.get('height')});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
}
}
},
@ -327,6 +326,7 @@ Y.extend(DIALOGUE, Y.Panel, {
if (hidden) {
bb.addClass(DIALOGUE_HIDDEN_CLASS);
}
this.makeResponsive();
},
/**
* Return whether this dialogue should be fullscreen or not.

View File

@ -90,7 +90,6 @@ Y.extend(DIALOGUE, Y.Panel, {
if (this.get('render')) {
this.render();
}
this.makeResponsive();
this.after('visibleChange', this.visibilityChanged, this);
if (this.get('center')) {
this.centerDialogue();
@ -123,10 +122,14 @@ Y.extend(DIALOGUE, Y.Panel, {
if (!this.get('center')) {
this._originalPosition = bb.getXY();
}
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
if (bb.getStyle('position') !== 'fixed') {
// If the boundingBox has been positioned in a fixed manner, then it will not position correctly to scrollTop.
bb.setStyles({
top: w.get('scrollTop'),
left: w.get('scrollLeft')
});
}
}, this);
// Remove the dialogue from the DOM when it is destroyed.
@ -245,8 +248,7 @@ Y.extend(DIALOGUE, Y.Panel, {
* @method makeResponsive
*/
makeResponsive : function() {
var bb = this.get('boundingBox'),
content;
var bb = this.get('boundingBox');
if (this.shouldResizeFullscreen()) {
// Make this dialogue fullscreen on a small screen.
@ -261,15 +263,12 @@ Y.extend(DIALOGUE, Y.Panel, {
'height' : null,
'right' : null,
'bottom' : null});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
} else {
if (this.get('responsive')) {
// We must reset any of the fullscreen changes.
bb.removeClass(DIALOGUE_FULLSCREEN_CLASS)
.setStyles({'width' : this.get('width'),
'height' : this.get('height')});
content = Y.one('#' + this.get('id') + ' .' + CSS.BODY);
}
}
},
@ -298,6 +297,7 @@ Y.extend(DIALOGUE, Y.Panel, {
if (hidden) {
bb.addClass(DIALOGUE_HIDDEN_CLASS);
}
this.makeResponsive();
},
/**
* Return whether this dialogue should be fullscreen or not.