input
Feed = {
TemplateGetAttachmentPost: function (postID) {
// returned deferred object
return $.ajax({
/* ... */
})
},
TemplateWallPost: function (AppendTo, data) {
/* ... */
Feed.TemplateGetAttachmentPost(data.postID)
// success
.done(function(data){
console.log(data);
})
// error
.fail(function(){
console.error(arguments)
})
/* ... */
}
}
<div class="section">
<div class="title">
<h2>Заголовок</h2>
<div class="title__subtitle">Подзаголовок</div>
</div>
<div class="inner features">
<div class="features__item">
<div class="block">
<div class="block__icon">
<img class="block__image" src="images/icon1.png" alt="" />
</div>
<div class="block__text">Текст текст текст текст текст</div>
</div>
</div>
<div class="features__item">
<div class="block">
<div class="block__icon">
<img class="block__image" src="images/icon1.png" alt="" />
</div>
<div class="block__text">Текст текст текст текст текст</div>
</div>
</div>
</div>
</div>
@mixin transition-base($properties...){
// Свойство transition-property по-умолчанию равно значению all
// т.е. запись transition: 250ms ease 0s; будет
// эквивалентна записи transition: all 250ms ease 0s;
transition: 250ms ease 0s;
@if length($properties) > 0 {
transition-property: $properties;
}
}
@include transition-base();
@include transition-base(padding, color, border-color);
class AdjacencyList
{
private static $tmpData;
public static function renderUnorderedList($rgData, \Closure $callback)
{
$html = '<ul>';
foreach ($rgData as $item) {
$children = $item['children'];
$item['children'] = !empty($children);
$html .= '<li>';
ob_start();
$callback($item);
$html .= ob_get_clean();
if (!empty($children)) {
$html .= self::renderUnorderedList($children, $callback);
}
$html .= '</li>';
}
$html .= '</ul>';
return $html;
}
public static function buildTree($rgData, $start = 0, $idKey = 'id', $idParentKey = 'parent_id')
{
self::$tmpData = self::assignKeys($rgData);
$result = self::buildTreeRecursive($start, $idKey, $idParentKey);
return $result;
}
private static function buildTreeRecursive($start, $idKey, $idParentKey)
{
$rgResult = array();
foreach (self::$tmpData as $item) {
if ($item[$idParentKey] == $start) {
$item['children'] = self::buildTreeRecursive($item[$idKey], $idKey, $idParentKey);
$rgResult[] = $item;
}
}
return empty($rgResult) ? null : $rgResult;
}
private static function assignKeys($rgData, $key = 'id')
{
$tmp = array();
foreach ($rgData as $item) {
$tmp[$item[$key]] = $item;
}
return $tmp;
}
}
.col-xs-1of5, .col-sm-1of5, .col-md-1of5, .col-lg-1of5, .col-xl-1of5 {
@include make-col-ready();
width: 100%;
}
.col-xs-1of5 { @include make-col(1, 5); }
@include media-breakpoint-up(sm) { .col-sm-1of5 { @include make-col(1, 5); } }
@include media-breakpoint-up(md) { .col-md-1of5 { @include make-col(1, 5); } }
@include media-breakpoint-up(lg) { .col-lg-1of5 { @include make-col(1, 5); } }
@include media-breakpoint-up(xl) { .col-xl-1of5 { @include make-col(1, 5); } }
<div class="col-sm-1of5">1</div>
<div class="col-sm-1of5">2</div>
<div class="col-sm-1of5">3</div>
<div class="col-sm-1of5">4</div>
<div class="col-sm-1of5">5</div>