From 95fd09e2c8b06ed1f11fd859e04e8f9094e8c6bb Mon Sep 17 00:00:00 2001 From: NelinD Date: Sat, 25 Jun 2016 20:20:01 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=91=D0=B0=D0=B3=20=D1=81=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B1=D0=BE=D1=80=D0=BE=D0=BC=20=D0=BC=D0=B5=D1=81=D1=82?= =?UTF-8?q?=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=D0=B8=D0=B4=D0=B6=D0=B5=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http://joxi.ru/gmveXqqSxo9q7r При нажатии на кнопку место использования виджета на зависимых страницах не устанавливалось из-за отсутствия дата атрибута с данными --- src/resources/js/WidgetController.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/resources/js/WidgetController.js b/src/resources/js/WidgetController.js index fa90d13..1579e1d 100644 --- a/src/resources/js/WidgetController.js +++ b/src/resources/js/WidgetController.js @@ -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); @@ -251,4 +246,4 @@ function load_snippets(intervalID) { load_snippets(intervalID); }, 10000); }); -} \ No newline at end of file +}