Skip to content

Commit

Permalink
Allow to add actions on contacts that will open a new window
Browse files Browse the repository at this point in the history
  • Loading branch information
kitan1982 committed Oct 5, 2015
1 parent 9b37229 commit 4524eca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Menu/ContactAdditionalActionsMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public function __construct(
protected function renderLinkElement(ItemInterface $item, array $options)
{
$uri = $item->getExtra('href') ? $item->getExtra('href'): $item->getUri();
$displayMode = $item->getExtra('display') ? $item->getExtra('display'): 'normal';

return sprintf(
'<i class="%s contact-action" data-url="%s" data-toggle="tooltip" data-placement="left" title="%s"></i>',
'<i class="%s contact-action" data-url="%s" data-toggle="tooltip" data-placement="left" title="%s" data-display-mode="%s"></i>',
$item->getExtra('icon'),
$this->escape($uri),
$this->renderLabel($item, $options)
$this->renderLabel($item, $options),
$displayMode
);
}

Expand Down
14 changes: 13 additions & 1 deletion Resources/public/js/contact/myContactsToolIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,19 @@
$('#all-my-contacts-content-body').on('click', '.contact-additional-action', function (event) {
var child = $(this).children('.contact-action');
var url = child.data('url');
window.location = url;
var displayMode = child.data('display-mode');

if (displayMode === 'new_small_window') {

window.open(
url,
'',
'toolbar=0,menubar=0,titlebar=0,location=0,status=0,left=150,top=200,width=200,height=300',
false
).focus();
} else {
window.location = url;
}
});

$('#all-my-contacts-content-body').on('change', '#max-select', function() {
Expand Down

0 comments on commit 4524eca

Please sign in to comment.