Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge branch 'MDL-60633-33' of git://github.com/andrewnicols/moodle i…
- Loading branch information
Showing
with
10 additions
and
1 deletion.
-
+1
−1
lib/amd/build/inplace_editable.min.js
-
+9
−0
lib/amd/src/inplace_editable.js
Some generated files are not rendered by default. Learn more.
Oops, something went wrong.
|
@@ -60,6 +60,13 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' |
|
|
}; |
|
|
|
|
|
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([{ |
|
@@ -77,6 +84,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' |
|
|
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) { |
|
@@ -85,6 +93,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str' |
|
|
newvalue: value |
|
|
}); |
|
|
removeSpinner(mainelement); |
|
|
M.util.js_complete(pendingId); |
|
|
mainelement.trigger(e); |
|
|
if (!e.isDefaultPrevented()) { |
|
|
notification.exception(ex); |
|
|