Skip to content

Commit

Permalink
v1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gevorgmansuryan committed Oct 13, 2017
1 parent 4a1ae5a commit 1b3a48e
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions src/LazyBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,31 @@ public function init()

public function run()
{
$content = ob_get_clean();
return Html::tag('div', $content, ArrayHelper::merge($this->options, [
'id' => $this->id,
'class' => [
'lazy-load-box',
'trigger',
$this->effect
],
'style' => [
'-webkit-transition' => "all {$this->speed}ms ease",
'-moz-transition' => "all {$this->speed}ms ease",
'-ms-transition' => "all {$this->speed}ms ease",
'-o-transition' => "all {$this->speed}ms ease",
'transition' => "all {$this->speed}ms ease",
],
'data' => [
'delay' => $this->delay,
'speed' => $this->speed
]
]));
$this->options['id'] = $this->id;
$this->options['class'] = (array)$this->options['class'];
if ($this->effect) {
$this->options = ArrayHelper::merge(
$this->options, [
'class' => [
'lazy-load-box',
'trigger',
$this->effect
],
'style' => [
'-webkit-transition' => "all {$this->speed}ms ease",
'-moz-transition' => "all {$this->speed}ms ease",
'-ms-transition' => "all {$this->speed}ms ease",
'-o-transition' => "all {$this->speed}ms ease",
'transition' => "all {$this->speed}ms ease",
],
'data' => [
'delay' => $this->delay,
'speed' => $this->speed
]
]
);
}

return Html::tag('div', ob_get_clean(), $this->options);
}
}

0 comments on commit 1b3a48e

Please sign in to comment.