Skip to content

Commit

Permalink
Merge pull request #1 from NelinD/NelinD-patch-1
Browse files Browse the repository at this point in the history
fix: Баг с выбором мест использования виджета
  • Loading branch information
NelinD authored Jun 25, 2016
2 parents 3d1ff63 + 95fd09e commit 6217623
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/resources/js/WidgetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,9 @@ CMS.controllers.add('widget.get.location', function () {

$('.table tbody tr[data-parent-id="' + id + '"]').each(function () {
var $select = $(this).find('select.widget-blocks');
var $options = $select.data('blocks');

for (i in $options) {
var $option = $options[i];
if ($option['id'] == block_name) {
$select.val($option['id']).trigger('change');
}

if ($select.find('option[value=' + block_name + ']').length) {
$select.val(block_name).trigger('change');
}

$(this).find('input.widget-position').val(position);
Expand Down Expand Up @@ -251,4 +246,4 @@ function load_snippets(intervalID) {
load_snippets(intervalID);
}, 10000);
});
}
}

0 comments on commit 6217623

Please sign in to comment.