This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (empty($parent)) {$parent = $modx->resource->id;} | |
$pids = array_merge(array($parent), $modx->getChildIds($parent)); | |
$ids = array(); | |
$q = $modx->newQuery('msProduct'); | |
$q->where(array('class_key' => 'msProduct','parent:IN' => $pids,'published' => 1,'deleted' => 0)); | |
$q->select('`msProduct`.`id`'); | |
if ($q->prepare() && $q->stmt->execute()) { | |
$ids = $q->stmt->fetchAll(PDO::FETCH_COLUMN); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
switch ($modx->event->name) { | |
case 'msopOnModificationSave': | |
$modification = $modx->getOption('modification', $scriptProperties); | |
if (!$modification) { | |
return; | |
} | |
/** @var msProduct $product */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pdo = $modx->getService('pdoTools'); | |
$fieldName = $modx->getOption('fieldName', $scriptProperties, 'vendor'); | |
$fieldClass = $modx->getOption('fieldClass', $scriptProperties, ''); | |
$firstOption = $modx->getOption('firstOption', $scriptProperties, ''); | |
$parent = $modx->getOption('parent', $scriptProperties, $modx->resource->get('id')); | |
$depth = $modx->getOption('depth', $scriptProperties, 10); | |
$limit = $modx->getOption('limit', $scriptProperties, 100); | |
$tplOuter = $modx->getOption('tplOuter', $scriptProperties, '@INLINE <ul class="brands">[[+rows]]</ul>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Equal Heights for OwlCarousel 2 */ | |
.owl-carousel { | |
.owl-stage { | |
display: flex; | |
} | |
.owl-item { | |
display: flex; | |
flex: 1 0 auto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// textarea auto expand | |
var textarea = document.querySelector('textarea'); | |
textarea.addEventListener('keydown', autosize); | |
function autosize(){ | |
var el = this; | |
setTimeout(function(){ | |
el.style.cssText = ''; | |
el.style.cssText = 'height:' + el.scrollHeight + 'px'; | |
},0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<textarea name="message" data-max="50" ></textarea> | |
$('.symbol-count').keyup(function () { | |
var max = $(this).data('max'); | |
var len = $(this).val().length; | |
$(this).closest('form').find('.symbol-count').find('span').text(len); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tabs"> | |
<ul class="tabs__caption"> | |
<li class="active">1-я вкладка</li> | |
<li>2-я вкладка</li> | |
</ul> | |
<div class="tabs__content active"> | |
Содержимое первого блока | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.ace_editor, .ace_editor div{ font-family:monospace } |
OlderNewer