mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'MDL-40975-overflow' of git://github.com/andrewnicols/moodle
Conflicts: theme/bootstrapbase/style/moodle.css
This commit is contained in:
commit
81b07e655c
12 changed files with 177 additions and 160 deletions
|
@ -859,7 +859,8 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
}
|
||||
} else {
|
||||
// No link, so display only content.
|
||||
$output = html_writer::tag('div', $accesstext . $content, array('class' => $textclasses));
|
||||
$output = html_writer::tag('div', $accesstext . $content,
|
||||
array('class' => 'contentwithoutlink ' . $textclasses));
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
@ -982,23 +983,34 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
$output .= course_get_cm_move($mod, $sectionreturn);
|
||||
}
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => $indentclasses));
|
||||
$output .= html_writer::start_tag('div', array('class' => 'mod-indent-outer'));
|
||||
|
||||
// Start the div for the activity title, excluding the edit icons.
|
||||
$output .= html_writer::start_tag('div', array('class' => 'activityinstance'));
|
||||
// This div is used to indent the content.
|
||||
$output .= html_writer::div('', $indentclasses);
|
||||
|
||||
// Start a wrapper for the actual content to keep the indentation consistent
|
||||
$output .= html_writer::start_tag('div');
|
||||
|
||||
// Display the link to the module (or do nothing if module has no url)
|
||||
$output .= $this->course_section_cm_name($mod, $displayoptions);
|
||||
if ($this->page->user_is_editing()) {
|
||||
$output .= ' ' . course_get_cm_rename_action($mod, $sectionreturn);
|
||||
$cmname = $this->course_section_cm_name($mod, $displayoptions);
|
||||
|
||||
if (!empty($cmname)) {
|
||||
// Start the div for the activity title, excluding the edit icons.
|
||||
$output .= html_writer::start_tag('div', array('class' => 'activityinstance'));
|
||||
$output .= $cmname;
|
||||
|
||||
|
||||
if ($this->page->user_is_editing()) {
|
||||
$output .= ' ' . course_get_cm_rename_action($mod, $sectionreturn);
|
||||
}
|
||||
|
||||
// Module can put text after the link (e.g. forum unread)
|
||||
$output .= $mod->get_after_link();
|
||||
|
||||
// Closing the tag which contains everything but edit icons. Content part of the module should not be part of this.
|
||||
$output .= html_writer::end_tag('div'); // .activityinstance
|
||||
}
|
||||
|
||||
// Module can put text after the link (e.g. forum unread)
|
||||
$output .= $mod->get_after_link();
|
||||
|
||||
// Closing the tag which contains everything but edit icons. Content part of the module should not be part of this.
|
||||
$output .= html_writer::end_tag('div'); // .activityinstance
|
||||
|
||||
// If there is content but NO link (eg label), then display the
|
||||
// content here (BEFORE any icons). In this case cons must be
|
||||
// displayed after the content so that it makes more sense visually
|
||||
|
@ -1033,7 +1045,10 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
// show availability info (if module is not available)
|
||||
$output .= $this->course_section_cm_availability($mod, $displayoptions);
|
||||
|
||||
$output .= html_writer::end_tag('span'); // $indentclasses
|
||||
$output .= html_writer::end_tag('div'); // $indentclasses
|
||||
|
||||
// End of indentation div.
|
||||
$output .= html_writer::end_tag('div');
|
||||
|
||||
$output .= html_writer::end_tag('div');
|
||||
return $output;
|
||||
|
|
6
course/yui/dragdrop/dragdrop.js
vendored
6
course/yui/dragdrop/dragdrop.js
vendored
|
@ -1,9 +1,9 @@
|
|||
YUI.add('moodle-course-dragdrop', function(Y) {
|
||||
|
||||
var CSS = {
|
||||
ACTIONAREA: '.actions',
|
||||
ACTIVITY : 'activity',
|
||||
ACTIVITYINSTANCE : 'activityinstance',
|
||||
COMMANDSPAN : '.commands',
|
||||
CONTENT : 'content',
|
||||
COURSECONTENT : 'course-content',
|
||||
EDITINGMOVE : 'editing_move',
|
||||
|
@ -375,8 +375,8 @@ YUI.add('moodle-course-dragdrop', function(Y) {
|
|||
var dropnode = e.drop.get('node');
|
||||
|
||||
// Add spinner if it not there
|
||||
var activityinstance = dragnode.one('.' + CSS.ACTIVITYINSTANCE);
|
||||
var spinner = M.util.add_spinner(Y, activityinstance);
|
||||
var actionarea = dragnode.one(CSS.ACTIONAREA);
|
||||
var spinner = M.util.add_spinner(Y, actionarea);
|
||||
|
||||
var params = {};
|
||||
|
||||
|
|
22
course/yui/toolboxes/toolboxes.js
vendored
22
course/yui/toolboxes/toolboxes.js
vendored
|
@ -9,6 +9,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
var CSS = {
|
||||
ACTIVITYINSTANCE : 'activityinstance',
|
||||
AVAILABILITYINFODIV : 'div.availabilityinfo',
|
||||
CONTENTWITHOUTLINK : 'contentwithoutlink',
|
||||
CONDITIONALHIDDEN : 'conditionalhidden',
|
||||
DIMCLASS : 'dimmed',
|
||||
DIMMEDTEXT : 'dimmed_text',
|
||||
|
@ -25,6 +26,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
},
|
||||
// The CSS selectors we use.
|
||||
SELECTOR = {
|
||||
ACTIONAREA: '.actions',
|
||||
ACTIONLINKTEXT : '.actionlinktext',
|
||||
ACTIVITYACTION : 'a.cm-edit-action[data-action], a.editing_title',
|
||||
ACTIVITYFORM : '.' + CSS.ACTIVITYINSTANCE + ' form',
|
||||
|
@ -35,11 +37,13 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
ACTIVITYTITLE : 'input[name=title]',
|
||||
COMMANDSPAN : '.commands',
|
||||
CONTENTAFTERLINK : 'div.contentafterlink',
|
||||
CONTENTWITHOUTLINK : 'div.contentwithoutlink',
|
||||
EDITTITLE: 'a.editing_title',
|
||||
HIDE : 'a.editing_hide',
|
||||
HIGHLIGHT : 'a.editing_highlight',
|
||||
INSTANCENAME : 'span.instancename',
|
||||
MODINDENTDIV : '.mod-indent',
|
||||
MODINDENTOUTER : '.mod-indent-outer',
|
||||
PAGECONTENT : 'div#page-content',
|
||||
SECTIONLI : 'li.section',
|
||||
SHOW : 'a.'+CSS.SHOW,
|
||||
|
@ -291,13 +295,8 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
}
|
||||
},
|
||||
add_spinner: function(activity) {
|
||||
var instance = activity.one(SELECTOR.ACTIVITYINSTANCE);
|
||||
|
||||
if (instance) {
|
||||
return M.util.add_spinner(Y, instance);
|
||||
} else {
|
||||
return M.util.add_spinner(Y, activity);
|
||||
}
|
||||
var actionarea = activity.one(SELECTOR.ACTIONAREA);
|
||||
return M.util.add_spinner(Y, actionarea);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -506,7 +505,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
*/
|
||||
handle_resource_dim : function(button, activity, action) {
|
||||
var toggleclass = CSS.DIMCLASS,
|
||||
dimarea = activity.one('a'),
|
||||
dimarea = activity.one('a, .contentwithoutlink'),
|
||||
availabilityinfo = activity.one(CSS.AVAILABILITYINFODIV),
|
||||
nextaction = (action === 'hide') ? 'show' : 'hide',
|
||||
buttontext = button.one('span'),
|
||||
|
@ -524,11 +523,12 @@ YUI.add('moodle-course-toolboxes', function(Y) {
|
|||
buttontext.set('text', newstring);
|
||||
}
|
||||
|
||||
// If activity is conditionally hidden, then don't toggle.
|
||||
if (Y.Moodle.core_course.util.cm.getName(activity) === null) {
|
||||
if (activity.one(SELECTOR.CONTENTWITHOUTLINK)) {
|
||||
dimarea = activity.one(SELECTOR.CONTENTWITHOUTLINK);
|
||||
toggleclass = CSS.DIMMEDTEXT;
|
||||
dimarea = activity.all(SELECTOR.MODINDENTDIV + ' > div').item(1);
|
||||
}
|
||||
|
||||
// If activity is conditionally hidden, then don't toggle.
|
||||
if (!dimarea.hasClass(CSS.CONDITIONALHIDDEN)) {
|
||||
// Change the UI.
|
||||
dimarea.toggleClass(toggleclass);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue