Merge branch 'MDL-59628-master' of git://github.com/damyon/moodle
This commit is contained in:
+26
-4
@@ -2,6 +2,11 @@ YUI.add('moodle-form-dateselector', function (Y, NAME) {
|
||||
|
||||
/* global CALENDAR, MOODLECALENDAR */
|
||||
|
||||
var DIALOGUE_SELECTOR = ' [role=dialog]',
|
||||
MENUBAR_SELECTOR = '[role=menubar]',
|
||||
DOT = '.',
|
||||
HAS_ZINDEX = 'moodle-has-zindex';
|
||||
|
||||
/**
|
||||
* Add some custom methods to the node class to make our lives a little
|
||||
* easier within this module.
|
||||
@@ -73,10 +78,19 @@ M.form.dateselector = {
|
||||
constrain: true // constrain panel to viewport.
|
||||
});
|
||||
this.panel.render(document.body);
|
||||
// zIndex is added by panel.render() and is set to 0.
|
||||
// Remove zIndex from panel, as this should be set by CSS. This can be done by removeAttr but
|
||||
// ie8 fails and there is know issue for it.
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', null);
|
||||
|
||||
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
|
||||
var highestzindex = 0;
|
||||
Y.all(DIALOGUE_SELECTOR + ', ' + MENUBAR_SELECTOR + ', ' + DOT + HAS_ZINDEX).each(function(node) {
|
||||
var zindex = this.findZIndex(node);
|
||||
if (zindex > highestzindex) {
|
||||
highestzindex = zindex;
|
||||
}
|
||||
}, this);
|
||||
// Only set the zindex if we found a wrapper.
|
||||
var zindexvalue = (highestzindex + 1).toString();
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', zindexvalue);
|
||||
|
||||
this.panel.on('heightChange', this.fix_position, this);
|
||||
|
||||
Y.one('#dateselector-calendar-panel').on('click', function(e) {
|
||||
@@ -100,6 +114,14 @@ M.form.dateselector = {
|
||||
config.sat]
|
||||
});
|
||||
},
|
||||
findZIndex: function(node) {
|
||||
// In most cases the zindex is set on the parent of the dialog.
|
||||
var zindex = node.getStyle('zIndex') || node.ancestor().getStyle('zIndex');
|
||||
if (zindex) {
|
||||
return parseInt(zindex, 10);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
cancel_any_timeout: function() {
|
||||
if (this.hidetimeout) {
|
||||
clearTimeout(this.hidetimeout);
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -2,6 +2,11 @@ YUI.add('moodle-form-dateselector', function (Y, NAME) {
|
||||
|
||||
/* global CALENDAR, MOODLECALENDAR */
|
||||
|
||||
var DIALOGUE_SELECTOR = ' [role=dialog]',
|
||||
MENUBAR_SELECTOR = '[role=menubar]',
|
||||
DOT = '.',
|
||||
HAS_ZINDEX = 'moodle-has-zindex';
|
||||
|
||||
/**
|
||||
* Add some custom methods to the node class to make our lives a little
|
||||
* easier within this module.
|
||||
@@ -73,10 +78,19 @@ M.form.dateselector = {
|
||||
constrain: true // constrain panel to viewport.
|
||||
});
|
||||
this.panel.render(document.body);
|
||||
// zIndex is added by panel.render() and is set to 0.
|
||||
// Remove zIndex from panel, as this should be set by CSS. This can be done by removeAttr but
|
||||
// ie8 fails and there is know issue for it.
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', null);
|
||||
|
||||
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
|
||||
var highestzindex = 0;
|
||||
Y.all(DIALOGUE_SELECTOR + ', ' + MENUBAR_SELECTOR + ', ' + DOT + HAS_ZINDEX).each(function(node) {
|
||||
var zindex = this.findZIndex(node);
|
||||
if (zindex > highestzindex) {
|
||||
highestzindex = zindex;
|
||||
}
|
||||
}, this);
|
||||
// Only set the zindex if we found a wrapper.
|
||||
var zindexvalue = (highestzindex + 1).toString();
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', zindexvalue);
|
||||
|
||||
this.panel.on('heightChange', this.fix_position, this);
|
||||
|
||||
Y.one('#dateselector-calendar-panel').on('click', function(e) {
|
||||
@@ -100,6 +114,14 @@ M.form.dateselector = {
|
||||
config.sat]
|
||||
});
|
||||
},
|
||||
findZIndex: function(node) {
|
||||
// In most cases the zindex is set on the parent of the dialog.
|
||||
var zindex = node.getStyle('zIndex') || node.ancestor().getStyle('zIndex');
|
||||
if (zindex) {
|
||||
return parseInt(zindex, 10);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
cancel_any_timeout: function() {
|
||||
if (this.hidetimeout) {
|
||||
clearTimeout(this.hidetimeout);
|
||||
|
||||
+26
-4
@@ -1,5 +1,10 @@
|
||||
/* global CALENDAR, MOODLECALENDAR */
|
||||
|
||||
var DIALOGUE_SELECTOR = ' [role=dialog]',
|
||||
MENUBAR_SELECTOR = '[role=menubar]',
|
||||
DOT = '.',
|
||||
HAS_ZINDEX = 'moodle-has-zindex';
|
||||
|
||||
/**
|
||||
* Add some custom methods to the node class to make our lives a little
|
||||
* easier within this module.
|
||||
@@ -71,10 +76,19 @@ M.form.dateselector = {
|
||||
constrain: true // constrain panel to viewport.
|
||||
});
|
||||
this.panel.render(document.body);
|
||||
// zIndex is added by panel.render() and is set to 0.
|
||||
// Remove zIndex from panel, as this should be set by CSS. This can be done by removeAttr but
|
||||
// ie8 fails and there is know issue for it.
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', null);
|
||||
|
||||
// Determine the correct zindex by looking at all existing dialogs and menubars in the page.
|
||||
var highestzindex = 0;
|
||||
Y.all(DIALOGUE_SELECTOR + ', ' + MENUBAR_SELECTOR + ', ' + DOT + HAS_ZINDEX).each(function(node) {
|
||||
var zindex = this.findZIndex(node);
|
||||
if (zindex > highestzindex) {
|
||||
highestzindex = zindex;
|
||||
}
|
||||
}, this);
|
||||
// Only set the zindex if we found a wrapper.
|
||||
var zindexvalue = (highestzindex + 1).toString();
|
||||
Y.one('#dateselector-calendar-panel').setStyle('zIndex', zindexvalue);
|
||||
|
||||
this.panel.on('heightChange', this.fix_position, this);
|
||||
|
||||
Y.one('#dateselector-calendar-panel').on('click', function(e) {
|
||||
@@ -98,6 +112,14 @@ M.form.dateselector = {
|
||||
config.sat]
|
||||
});
|
||||
},
|
||||
findZIndex: function(node) {
|
||||
// In most cases the zindex is set on the parent of the dialog.
|
||||
var zindex = node.getStyle('zIndex') || node.ancestor().getStyle('zIndex');
|
||||
if (zindex) {
|
||||
return parseInt(zindex, 10);
|
||||
}
|
||||
return 0;
|
||||
},
|
||||
cancel_any_timeout: function() {
|
||||
if (this.hidetimeout) {
|
||||
clearTimeout(this.hidetimeout);
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
@import "fontawesome/font-awesome";
|
||||
@import "fontawesome/moodle-path";
|
||||
|
||||
// Import the Moodle variables.
|
||||
@import "moodle/variables.less";
|
||||
|
||||
// Old Moodle stuff from base theme.
|
||||
// Massive, needs broken up.
|
||||
@import "moodle/core";
|
||||
|
||||
@@ -22,9 +22,6 @@
|
||||
|
||||
// Calendar restyling.
|
||||
.path-calendar {
|
||||
#dateselector-calendar-panel {
|
||||
z-index: @zindexModalContainer+4;
|
||||
}
|
||||
.calendartable {
|
||||
width: 100%;
|
||||
th,
|
||||
|
||||
@@ -10,7 +10,7 @@ body {
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: @zindexModalContainer;
|
||||
z-index: 4050;
|
||||
outline: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
@@ -105,7 +105,6 @@ body {
|
||||
}
|
||||
|
||||
.modal-backdrop {
|
||||
z-index: @zindexModalContainerBackdrop;
|
||||
background-color: #aaa;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// Global variables for use within Moodle's less style sheets.
|
||||
// These should be unique and not override the variables defined
|
||||
// in Bootstrap.
|
||||
|
||||
@zindexModalContainer: 4050;
|
||||
@zindexModalContainerBackdrop: 4049;
|
||||
|
||||
@@ -5551,9 +5551,6 @@ img.iconsmall {
|
||||
.calendar_event_user {
|
||||
background-color: #dce7ec;
|
||||
}
|
||||
.path-calendar #dateselector-calendar-panel {
|
||||
z-index: 4054;
|
||||
}
|
||||
.path-calendar .calendartable {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -17071,7 +17068,6 @@ body.modal-open {
|
||||
border-radius: 0 0 10px 10px;
|
||||
}
|
||||
.modal-backdrop {
|
||||
z-index: 4049;
|
||||
background-color: #aaa;
|
||||
opacity: 0.4;
|
||||
}
|
||||
@@ -19326,7 +19322,6 @@ div[data-flexitour="backdrop"] {
|
||||
background-color: #000;
|
||||
opacity: 0.8;
|
||||
filter: alpha(opacity=80);
|
||||
z-index: 4049;
|
||||
background-color: #aaa;
|
||||
opacity: 0.4;
|
||||
z-index: 4030;
|
||||
|
||||
Reference in New Issue
Block a user