Skip to content

Commit

Permalink
Link: Introduce Link::openInModal() method
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 8, 2023
1 parent 5886506 commit bb2c5f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 77 deletions.
77 changes: 0 additions & 77 deletions src/Common/ModalOpener.php

This file was deleted.

14 changes: 14 additions & 0 deletions src/Widget/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,18 @@ public function createHrefAttribute()
{
return new Attribute('href', (string) $this->getUrl());
}

/**
* Open this link in a modal
*
* @return $this
*/
public function openInModal(): self
{
$this->getAttributes()
->set('data-icinga-modal', true)
->set('data-no-icinga-ajax', true);

return $this;
}
}

0 comments on commit bb2c5f7

Please sign in to comment.