Skip to content

Commit

Permalink
Merge pull request #921 from HenryVolkmer/920-configurable-toolbarcon…
Browse files Browse the repository at this point in the history
…tainer

Make the css class of Toolbarcontainer configurable fix #746 fix #920
  • Loading branch information
kartik-v authored Aug 23, 2019
2 parents 9cdf9c2 + 48ca205 commit 48c2027
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -2084,7 +2084,18 @@ protected function renderToolbar()
protected function renderToolbarContainer()
{
$tag = ArrayHelper::remove($this->toolbarContainerOptions, 'tag', 'div');
$this->addCssClass($this->toolbarContainerOptions, self::BS_PULL_RIGHT);

/**
* allow to override the float declaration:
* forcing float-right only if no float is defined in toolbarContainerOptions
*/
if (
!strpos($this->toolbarContainerOptions['class'],$this->getCssClass(self::BS_PULL_RIGHT))
&& !strpos($this->toolbarContainerOptions['class'],$this->getCssClass(self::BS_PULL_LEFT))
) {
$this->addCssClass($this->toolbarContainerOptions, self::BS_PULL_RIGHT);
}

return Html::tag($tag, $this->renderToolbar(), $this->toolbarContainerOptions);
}

Expand Down

0 comments on commit 48c2027

Please sign in to comment.