summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/contextual/js/contextual.js
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2013-11-23 20:30:21 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2013-11-23 20:30:21 -0800
commitc48c94111fe0c78ca87fe172ddf59d33406166d4 (patch)
tree9c369a32e3c94f1ce0bc2bf4edae540c3ce9edb1 /core/modules/contextual/js/contextual.js
parentb413088e681692db49103b15eff3dbbadbbea7de (diff)
downloaddrupal-c48c94111fe0c78ca87fe172ddf59d33406166d4.tar.gz
drupal-c48c94111fe0c78ca87fe172ddf59d33406166d4.zip
Issue #2047671 by jessebeach, Wim Leers, nod, xjm: Expanded contextual links look goofy when there are no items.
Diffstat (limited to 'core/modules/contextual/js/contextual.js')
-rw-r--r--core/modules/contextual/js/contextual.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js
index 755145cb1b9d..ab404a23cc1a 100644
--- a/core/modules/contextual/js/contextual.js
+++ b/core/modules/contextual/js/contextual.js
@@ -137,7 +137,10 @@ Drupal.behaviors.contextual = {
dataType: 'json',
success: function (results) {
for (var id in results) {
- if (results.hasOwnProperty(id)) {
+ // If the rendered contextual links are empty, then the current user
+ // does not have permission to access the associated links: don't
+ // render anything.
+ if (results.hasOwnProperty(id) && results[id].length > 0) {
// Update the placeholders to contain its rendered contextual links.
// Usually there will only be one placeholder, but it's possible for
// multiple identical placeholders exist on the page (probably