Commit 81f886ab authored by Sam152's avatar Sam152 Committed by Sam152
Browse files

Issue #2646530 by Sam152: Remove the ColorboxAttachment::alreadyAdded flag

parent f1d4587b
...@@ -35,13 +35,6 @@ class ColorboxAttachment implements PageAttachmentInterface { ...@@ -35,13 +35,6 @@ class ColorboxAttachment implements PageAttachmentInterface {
*/ */
protected $settings; protected $settings;
/**
* If colorbox has already been added to the page.
*
* @var bool
*/
static $alreadyAdded = FALSE;
/** /**
* Create an instance of ColorboxAttachment. * Create an instance of ColorboxAttachment.
*/ */
...@@ -55,15 +48,13 @@ class ColorboxAttachment implements PageAttachmentInterface { ...@@ -55,15 +48,13 @@ class ColorboxAttachment implements PageAttachmentInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function isApplicable() { public function isApplicable() {
return !drupal_installation_attempted() && !static::$alreadyAdded && $this->activation->isActive(); return !drupal_installation_attempted() && $this->activation->isActive();
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function attach(array &$page) { public function attach(array &$page) {
static::$alreadyAdded = TRUE;
if ($this->settings->get('custom.activate')) { if ($this->settings->get('custom.activate')) {
$js_settings = array( $js_settings = array(
'transition' => $this->settings->get('custom.transition_type'), 'transition' => $this->settings->get('custom.transition_type'),
......
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