Skip to content

Commit

Permalink
Issue #2648236 by Berdir: Give iframes a name to facilitate testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Berdir committed Jan 25, 2016
1 parent a39e6ab commit a0d3351
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/entity_browser.iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
'width' : drupalSettings['entity_browser']['iframe'][uuid]['width'],
'height' : drupalSettings['entity_browser']['iframe'][uuid]['height'],
'data-uuid' : uuid,
'data-original-path' : original_path
'data-original-path' : original_path,
'name' : 'entity-browser-iframe-' + drupalSettings['entity_browser']['iframe'][uuid]['entity_browser_id'].replace('_', '-')
}
);

Expand Down
4 changes: 3 additions & 1 deletion src/Plugin/EntityBrowser/Display/Modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace Drupal\entity_browser\Plugin\EntityBrowser\Display;

use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Uuid\UuidInterface;
use Drupal\Core\Ajax\OpenModalDialogCommand;
Expand Down Expand Up @@ -209,7 +210,8 @@ public function openModal(array &$form, FormStateInterface $form_state) {
'width' => '100%',
'height' => $this->configuration['height'] - 90,
'frameborder' => 0,
'style' => 'padding:'
'style' => 'padding:',
'name' => Html::cleanCssIdentifier('entity-browser-iframe-' . $this->configuration['entity_browser_id'])
],
];
$html = drupal_render($content);
Expand Down

0 comments on commit a0d3351

Please sign in to comment.