mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 05:28:30 +01:00
Merge branch 'MDL-83940-404' of https://github.com/paulholden/moodle into MOODLE_404_STABLE
This commit is contained in:
commit
10f47d3811
@ -72,16 +72,14 @@ M.core_comment = {
|
|||||||
scope.toggle_textarea(false);
|
scope.toggle_textarea(false);
|
||||||
},
|
},
|
||||||
post: function() {
|
post: function() {
|
||||||
|
var container = Y.one('#comment-list-'+this.client_id);
|
||||||
var ta = Y.one('#dlg-content-'+this.client_id);
|
var ta = Y.one('#dlg-content-'+this.client_id);
|
||||||
var scope = this;
|
var scope = this;
|
||||||
var value = ta.get('value');
|
var value = ta.get('value');
|
||||||
if (value && value != M.util.get_string('addcomment', 'moodle')) {
|
if (value && value != M.util.get_string('addcomment', 'moodle')) {
|
||||||
ta.set('disabled', true);
|
ta.set('disabled', true);
|
||||||
ta.setStyles({
|
var spinner = M.util.add_spinner(Y, container);
|
||||||
'backgroundImage': 'url(' + M.util.image_url('i/loading_small', 'core') + ')',
|
spinner.show();
|
||||||
'backgroundRepeat': 'no-repeat',
|
|
||||||
'backgroundPosition': 'center center'
|
|
||||||
});
|
|
||||||
var params = {'content': value};
|
var params = {'content': value};
|
||||||
this.request({
|
this.request({
|
||||||
action: 'add',
|
action: 'add',
|
||||||
@ -93,7 +91,7 @@ M.core_comment = {
|
|||||||
var ta = Y.one('#dlg-content-'+cid);
|
var ta = Y.one('#dlg-content-'+cid);
|
||||||
ta.set('value', '');
|
ta.set('value', '');
|
||||||
ta.set('disabled', false);
|
ta.set('disabled', false);
|
||||||
ta.setStyle('backgroundImage', 'none');
|
spinner.remove();
|
||||||
scope.toggle_textarea(false);
|
scope.toggle_textarea(false);
|
||||||
var container = Y.one('#comment-list-'+cid);
|
var container = Y.one('#comment-list-'+cid);
|
||||||
var result = await scope.render([obj], true);
|
var result = await scope.render([obj], true);
|
||||||
@ -401,8 +399,6 @@ M.core_comment = {
|
|||||||
var collapsedimage = 't/collapsed'; // ltr mode
|
var collapsedimage = 't/collapsed'; // ltr mode
|
||||||
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
if ( Y.one(document.body).hasClass('dir-rtl') ) {
|
||||||
collapsedimage = 't/collapsed_rtl';
|
collapsedimage = 't/collapsed_rtl';
|
||||||
} else {
|
|
||||||
collapsedimage = 't/collapsed';
|
|
||||||
}
|
}
|
||||||
if (img) {
|
if (img) {
|
||||||
img.set('src', M.util.image_url(collapsedimage, 'core'));
|
img.set('src', M.util.image_url(collapsedimage, 'core'));
|
||||||
@ -451,7 +447,8 @@ M.core_comment = {
|
|||||||
},
|
},
|
||||||
wait: function() {
|
wait: function() {
|
||||||
var container = Y.one('#comment-list-'+this.client_id);
|
var container = Y.one('#comment-list-'+this.client_id);
|
||||||
container.set('innerHTML', '<div class="mdl-align"><img src="'+M.util.image_url('i/loading_small', 'core')+'" /></div>');
|
container.set('innerHTML', '');
|
||||||
|
M.util.add_spinner(Y, container).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -458,8 +458,6 @@ class comment {
|
|||||||
$collapsedimage= 't/collapsed';
|
$collapsedimage= 't/collapsed';
|
||||||
if (right_to_left()) {
|
if (right_to_left()) {
|
||||||
$collapsedimage= 't/collapsed_rtl';
|
$collapsedimage= 't/collapsed_rtl';
|
||||||
} else {
|
|
||||||
$collapsedimage= 't/collapsed';
|
|
||||||
}
|
}
|
||||||
$html .= html_writer::start_tag('a', array(
|
$html .= html_writer::start_tag('a', array(
|
||||||
'class' => 'comment-link',
|
'class' => 'comment-link',
|
||||||
@ -468,7 +466,8 @@ class comment {
|
|||||||
'role' => 'button',
|
'role' => 'button',
|
||||||
'aria-expanded' => 'false')
|
'aria-expanded' => 'false')
|
||||||
);
|
);
|
||||||
$html .= $OUTPUT->pix_icon($collapsedimage, $this->linktext);
|
$html .= html_writer::img($OUTPUT->image_url($collapsedimage), $this->linktext,
|
||||||
|
['id' => 'comment-img-' . $this->cid, 'class' => 'icon']);
|
||||||
$html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid));
|
$html .= html_writer::tag('span', $this->linktext.' '.$countstring, array('id' => 'comment-link-text-'.$this->cid));
|
||||||
$html .= html_writer::end_tag('a');
|
$html .= html_writer::end_tag('a');
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,6 @@ M.util.CollapsibleRegion = function(Y, id, userpref, strtooltip) {
|
|||||||
var collapsedimage = 't/collapsed'; // ltr mode
|
var collapsedimage = 't/collapsed'; // ltr mode
|
||||||
if (right_to_left()) {
|
if (right_to_left()) {
|
||||||
collapsedimage = 't/collapsed_rtl';
|
collapsedimage = 't/collapsed_rtl';
|
||||||
} else {
|
|
||||||
collapsedimage = 't/collapsed';
|
|
||||||
}
|
}
|
||||||
if (this.div.hasClass('collapsed')) {
|
if (this.div.hasClass('collapsed')) {
|
||||||
// Add the correct image and record the YUI node created in the process
|
// Add the correct image and record the YUI node created in the process
|
||||||
|
Loading…
x
Reference in New Issue
Block a user