Skip to content

Commit

Permalink
renamed variable and fixed some css-problems in popover
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Aug 16, 2017
1 parent 9c8cdd5 commit 8112c2c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
32 changes: 16 additions & 16 deletions src/UI/Implementation/Component/Popover/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class Renderer extends AbstractComponentRenderer {
/**
* @inheritdoc
*/
public function render(Component\Component $component, RendererInterface $default_renderer) {
$this->checkComponent($component);
public function render(Component\Component $popover, RendererInterface $default_renderer) {
$this->checkComponent($popover);
$tpl = $this->getTemplate('tpl.popover.html', true, true);
$tpl->setVariable('FORCE_RENDERING', '');
/** @var Component\Popover\Popover $component */
/** @var Component\Popover\Popover $popover */

$replacement = array(
'"'=> '\"',
Expand All @@ -32,22 +32,22 @@ public function render(Component\Component $component, RendererInterface $defaul
);

$options = array(
'title' => $this->escape($component->getTitle()),
'placement' => $component->getPosition(),
'title' => $this->escape($popover->getTitle()),
'placement' => $popover->getPosition(),
'multi' => true,
'template' => str_replace(array_keys($replacement), array_values($replacement), $tpl->get()),
);

$is_async = $component->getAsyncContentUrl();
$is_async = $popover->getAsyncContentUrl();
if ($is_async) {
$options['type'] = 'async';
$options['url'] = $component->getAsyncContentUrl();
$options['url'] = $popover->getAsyncContentUrl();
}

$show = $component->getShowSignal();
$replace = $component->getReplaceContentSignal();
$show = $popover->getShowSignal();
$replace = $popover->getReplaceContentSignal();

$component = $component->withAdditionalOnLoadCode(function($id) use ($options, $show, $replace, $is_async) {
$popover = $popover->withAdditionalOnLoadCode(function($id) use ($options, $show, $replace, $is_async) {
if (!$is_async) {
$options["url"] = "#{$id}";
}
Expand All @@ -62,17 +62,17 @@ public function render(Component\Component $component, RendererInterface $defaul
});";
});

$id = $this->bindJavaScript($component);
$id = $this->bindJavaScript($popover);

if ($component->getAsyncContentUrl()) {
if ($popover->getAsyncContentUrl()) {
return '';
}

if ($component instanceof Component\Popover\Standard) {
return $this->renderStandardPopover($component, $default_renderer, $id);
if ($popover instanceof Component\Popover\Standard) {
return $this->renderStandardPopover($popover, $default_renderer, $id);
} else {
if ($component instanceof Component\Popover\Listing) {
return $this->renderListingPopover($component, $default_renderer, $id);
if ($popover instanceof Component\Popover\Listing) {
return $this->renderListingPopover($popover, $default_renderer, $id);
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/UI/templates/default/Popover/popover.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@popover-arrow-width: @il-popover-arrow-width;
@popover-arrow-color: @il-popover-arrow-background-color;
@popover-z-index: @il-popover-z-index;

@popover-max-height: @il-popover-max-height;
@popover-border-radius-base: 0px;
@popover-border-radius-large: 0px;
@popover-border-radius-small: 0px;
Expand All @@ -18,6 +18,10 @@
.webui-popover-content > div:first-child {
width: 100%;
}
.il-popover-inner {
max-height: @popover-max-height;
overflow: scroll;
}
i.icon-refresh {
background: url("@{uibase}/../../libs/node_modules/webui-popover/img/loading.gif") no-repeat;
height: 30px;
Expand All @@ -35,5 +39,7 @@
}

}

&.webui-popover-fixed {
position: fixed;
}
}

0 comments on commit 8112c2c

Please sign in to comment.