Skip to content

Commit

Permalink
Merge branch 'MDL-47734-master-fixes' of git://github.com/andrewnicol…
Browse files Browse the repository at this point in the history
…s/moodle
  • Loading branch information
danpoltawski committed Oct 27, 2014
2 parents 8378625 + 2af57bd commit a1ac634
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}
}
},
Expand Down Expand Up @@ -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.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}
}
},
Expand Down Expand Up @@ -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.
Expand Down
20 changes: 10 additions & 10 deletions lib/yui/src/notification/js/dialogue.js
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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);
}
}
},
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a1ac634

Please sign in to comment.