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 5d2d463 commit b11a32a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 77 deletions.
77 changes: 0 additions & 77 deletions src/Common/ModalOpener.php

This file was deleted.

18 changes: 18 additions & 0 deletions src/Widget/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,22 @@ 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(
Attributes::create([
'data-icinga-modal' => true,
'data-no-icinga-ajax' => true
])
);

return $this;
}
}

0 comments on commit b11a32a

Please sign in to comment.