Commit f641db54 authored by webchick's avatar webchick

Issue #2324211 by Wim Leers: Fixed Multiple requests to /quickedit/attachments...

Issue #2324211 by Wim Leers: Fixed Multiple requests to /quickedit/attachments when only one should happen.
parent 4ed1db5b
...@@ -394,11 +394,18 @@ ...@@ -394,11 +394,18 @@
var metadata = Drupal.quickedit.metadata.get(fieldModel.get('fieldID')); var metadata = Drupal.quickedit.metadata.get(fieldModel.get('fieldID'));
if (metadata.access && _.indexOf(loadedEditors, metadata.editor) === -1) { if (metadata.access && _.indexOf(loadedEditors, metadata.editor) === -1) {
missingEditors.push(metadata.editor); missingEditors.push(metadata.editor);
// Set a stub, to prevent subsequent calls to loadMissingEditors() from
// loading the same in-place editor again. Loading an in-place editor
// requires talking to a server, to download its JavaScript, then
// executing its JavaScript, and only then its Drupal.quickedit.editors
// entry will be set.
Drupal.quickedit.editors[metadata.editor] = false;
} }
}); });
missingEditors = _.uniq(missingEditors); missingEditors = _.uniq(missingEditors);
if (missingEditors.length === 0) { if (missingEditors.length === 0) {
callback(); callback();
return;
} }
// @todo Simplify this once https://drupal.org/node/1533366 lands. // @todo Simplify this once https://drupal.org/node/1533366 lands.
......
Markdown is supported
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