mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-73880 core_courseformat: fix section availability box
This commit is contained in:
parent
7fe8e34f7d
commit
ce887084fe
@ -6,6 +6,6 @@ define("core_courseformat/local/content/section",["exports","core_courseformat/l
|
||||
* @class core_courseformat/local/content/section
|
||||
* @copyright 2021 Ferran Recio <ferran@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_header=_interopRequireDefault(_header),_dndsection=_interopRequireDefault(_dndsection);class _default extends _dndsection.default{create(){this.name="content_section",this.selectors={SECTION_ITEM:"[data-for='section_title']",CM:'[data-for="cmitem"]'},this.classes={LOCKED:"editinprogress"},this.id=this.element.dataset.id}stateReady(state){if(this.configState(state),this.reactive.isEditing&&this.reactive.supportComponents){const sectionItem=this.getElement(this.selectors.SECTION_ITEM);if(sectionItem){const headerComponent=new _header.default({...this,element:sectionItem,fullregion:this.element});this.configDragDrop(headerComponent)}}}getWatchers(){return[{watch:"section[".concat(this.id,"]:updated"),handler:this._refreshSection}]}validateDropData(dropdata){return("section"!==(null==dropdata?void 0:dropdata.type)||0==this.reactive.sectionReturn)&&super.validateDropData(dropdata)}getLastCm(){const cms=this.getElements(this.selectors.CM);return cms&&0!==cms.length?cms[cms.length-1]:null}_refreshSection(_ref){var _element$dragging,_element$locked;let{element:element}=_ref;this.element.classList.toggle(this.classes.DRAGGING,null!==(_element$dragging=element.dragging)&&void 0!==_element$dragging&&_element$dragging),this.element.classList.toggle(this.classes.LOCKED,null!==(_element$locked=element.locked)&&void 0!==_element$locked&&_element$locked),this.locked=element.locked}}return _exports.default=_default,_exports.default}));
|
||||
*/Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_header=_interopRequireDefault(_header),_dndsection=_interopRequireDefault(_dndsection);class _default extends _dndsection.default{create(){this.name="content_section",this.selectors={SECTION_ITEM:"[data-for='section_title']",CM:'[data-for="cmitem"]',SECTIONINFO:'[data-for="sectioninfo"]'},this.classes={LOCKED:"editinprogress",HASDESCRIPTION:"description"},this.id=this.element.dataset.id}stateReady(state){if(this.configState(state),this.reactive.isEditing&&this.reactive.supportComponents){const sectionItem=this.getElement(this.selectors.SECTION_ITEM);if(sectionItem){const headerComponent=new _header.default({...this,element:sectionItem,fullregion:this.element});this.configDragDrop(headerComponent)}}}getWatchers(){return[{watch:"section[".concat(this.id,"]:updated"),handler:this._refreshSection}]}validateDropData(dropdata){return("section"!==(null==dropdata?void 0:dropdata.type)||0==this.reactive.sectionReturn)&&super.validateDropData(dropdata)}getLastCm(){const cms=this.getElements(this.selectors.CM);return cms&&0!==cms.length?cms[cms.length-1]:null}_refreshSection(_ref){var _element$dragging,_element$locked;let{element:element}=_ref;this.element.classList.toggle(this.classes.DRAGGING,null!==(_element$dragging=element.dragging)&&void 0!==_element$dragging&&_element$dragging),this.element.classList.toggle(this.classes.LOCKED,null!==(_element$locked=element.locked)&&void 0!==_element$locked&&_element$locked),this.locked=element.locked;const sectioninfo=this.getElement(this.selectors.SECTIONINFO);sectioninfo&§ioninfo.classList.toggle(this.classes.HASDESCRIPTION,element.hasrestrictions)}}return _exports.default=_default,_exports.default}));
|
||||
|
||||
//# sourceMappingURL=section.min.js.map
|
File diff suppressed because one or more lines are too long
@ -37,10 +37,12 @@ export default class extends DndSection {
|
||||
this.selectors = {
|
||||
SECTION_ITEM: `[data-for='section_title']`,
|
||||
CM: `[data-for="cmitem"]`,
|
||||
SECTIONINFO: `[data-for="sectioninfo"]`,
|
||||
};
|
||||
// Most classes will be loaded later by DndCmItem.
|
||||
this.classes = {
|
||||
LOCKED: 'editinprogress',
|
||||
HASDESCRIPTION: 'description',
|
||||
};
|
||||
|
||||
// We need our id to watch specific events.
|
||||
@ -120,5 +122,10 @@ export default class extends DndSection {
|
||||
this.element.classList.toggle(this.classes.DRAGGING, element.dragging ?? false);
|
||||
this.element.classList.toggle(this.classes.LOCKED, element.locked ?? false);
|
||||
this.locked = element.locked;
|
||||
// The description box classes depends on the section state.
|
||||
const sectioninfo = this.getElement(this.selectors.SECTIONINFO);
|
||||
if (sectioninfo) {
|
||||
sectioninfo.classList.toggle(this.classes.HASDESCRIPTION, element.hasrestrictions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -128,7 +128,7 @@
|
||||
class="content {{^iscoursedisplaymultipage}}
|
||||
{{^sitehome}}course-content-item-content collapse {{^contentcollapsed}}show{{/contentcollapsed}}{{/sitehome}}
|
||||
{{/iscoursedisplaymultipage}}">
|
||||
<div class="{{#hasavailability}}description small{{/hasavailability}} my-3">
|
||||
<div class="{{#hasavailability}}description{{/hasavailability}} my-3" data-for="sectioninfo">
|
||||
{{#summary}}
|
||||
{{$ core_courseformat/local/content/section/summary }}
|
||||
{{> core_courseformat/local/content/section/summary }}
|
||||
|
@ -1132,7 +1132,6 @@ span.editinstructions {
|
||||
}
|
||||
|
||||
> div {
|
||||
display: inline-block;
|
||||
float: right;
|
||||
|
||||
> div {
|
||||
@ -1340,6 +1339,8 @@ $activity-add-hover: theme-color-level('primary', -10) !default;
|
||||
}
|
||||
|
||||
.description .course-description-item {
|
||||
@include font-size($small-font-size);
|
||||
|
||||
background-color: $gray-100;
|
||||
padding-left: map-get($spacers, 3);
|
||||
padding-right: map-get($spacers, 3);
|
||||
|
@ -14561,7 +14561,6 @@ span.editinstructions {
|
||||
display: inline-block;
|
||||
text-align: left; }
|
||||
.coursecat-management-header > div {
|
||||
display: inline-block;
|
||||
float: right; }
|
||||
.coursecat-management-header > div > div {
|
||||
margin: 10px 0 10px 1em;
|
||||
@ -14707,6 +14706,7 @@ span.editinstructions {
|
||||
display: inline-block; }
|
||||
|
||||
.description .course-description-item {
|
||||
font-size: 80%;
|
||||
background-color: #f8f9fa;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem; }
|
||||
|
@ -14561,7 +14561,6 @@ span.editinstructions {
|
||||
display: inline-block;
|
||||
text-align: left; }
|
||||
.coursecat-management-header > div {
|
||||
display: inline-block;
|
||||
float: right; }
|
||||
.coursecat-management-header > div > div {
|
||||
margin: 10px 0 10px 1em;
|
||||
@ -14707,6 +14706,7 @@ span.editinstructions {
|
||||
display: inline-block; }
|
||||
|
||||
.description .course-description-item {
|
||||
font-size: 80%;
|
||||
background-color: #f8f9fa;
|
||||
padding-left: 1rem;
|
||||
padding-right: 1rem; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user