Commit 6e3314f0 authored by David Monllaó's avatar David Monllaó
Browse files

Merge branch 'MDL-60633-master' of git://github.com/andrewnicols/moodle

parents 2a542d02 314b8093
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -67,6 +67,13 @@ define(['jquery',
};
var updateValue = function(mainelement, value) {
var pendingId = [
mainelement.attr('data-itemid'),
mainelement.attr('data-component'),
mainelement.attr('data-itemtype'),
].join('-');
M.util.js_pending(pendingId);
addSpinner(mainelement);
ajax
.call([{
......@@ -84,6 +91,7 @@ define(['jquery',
templates.replaceNode(mainelement, newelement, js);
newelement.find('[data-inplaceeditablelink]').focus();
newelement.trigger({type: 'updated', ajaxreturn: data, oldvalue: oldvalue});
M.util.js_complete(pendingId);
});
},
fail: function(ex) {
......@@ -92,6 +100,7 @@ define(['jquery',
newvalue: value
});
removeSpinner(mainelement);
M.util.js_complete(pendingId);
mainelement.trigger(e);
if (!e.isDefaultPrevented()) {
notification.exception(ex);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment