mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-47773 comment: Indicate comment being saved via AJAX
This should be considered as quick & dirty usability fix as the whole JS should ideally be rewritten and this behaviour should use CSS classes.
This commit is contained in:
parent
20d38830ae
commit
3e4f5e6591
@ -65,6 +65,12 @@ M.core_comment = {
|
||||
var scope = this;
|
||||
var value = ta.get('value');
|
||||
if (value && value != M.util.get_string('addcomment', 'moodle')) {
|
||||
ta.set('disabled', true);
|
||||
ta.setStyles({
|
||||
'backgroundImage': 'url(' + M.util.image_url('i/loading_small', 'core') + ')',
|
||||
'backgroundRepeat': 'no-repeat',
|
||||
'backgroundPosition': 'center center'
|
||||
});
|
||||
var params = {'content': value};
|
||||
this.request({
|
||||
action: 'add',
|
||||
@ -75,6 +81,8 @@ M.core_comment = {
|
||||
var cid = scope.client_id;
|
||||
var ta = Y.one('#dlg-content-'+cid);
|
||||
ta.set('value', '');
|
||||
ta.set('disabled', false);
|
||||
ta.setStyle('backgroundImage', 'none');
|
||||
scope.toggle_textarea(false);
|
||||
var container = Y.one('#comment-list-'+cid);
|
||||
var result = scope.render([obj], true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user