|
3 | 3 | * Copyright © Magento, Inc. All rights reserved.
|
4 | 4 | * See COPYING.txt for license details.
|
5 | 5 | */
|
| 6 | + |
6 | 7 | namespace Magento\Review\Block\Adminhtml;
|
7 | 8 |
|
8 | 9 | /**
|
@@ -44,7 +45,8 @@ public function __construct(
|
44 | 45 | \Magento\Review\Helper\Action\Pager $reviewActionPager,
|
45 | 46 | \Magento\Framework\Registry $registry,
|
46 | 47 | array $data = []
|
47 |
| - ) { |
| 48 | + ) |
| 49 | + { |
48 | 50 | $this->_coreRegistry = $registry;
|
49 | 51 | $this->_reviewActionPager = $reviewActionPager;
|
50 | 52 | $this->_reviewFactory = $reviewFactory;
|
@@ -78,12 +80,12 @@ protected function _construct()
|
78 | 80 | [
|
79 | 81 | 'label' => __('Previous'),
|
80 | 82 | 'onclick' => 'setLocation(\'' . $this->getUrl(
|
81 |
| - 'review/*/*', |
82 |
| - [ |
83 |
| - 'id' => $prevId, |
84 |
| - 'ret' => $this->getRequest()->getParam('ret'), |
85 |
| - ] |
86 |
| - ) . '\')' |
| 83 | + 'review/*/*', |
| 84 | + [ |
| 85 | + 'id' => $prevId, |
| 86 | + 'ret' => $this->getRequest()->getParam('ret'), |
| 87 | + ] |
| 88 | + ) . '\')' |
87 | 89 | ],
|
88 | 90 | 3,
|
89 | 91 | 10
|
@@ -139,12 +141,12 @@ protected function _construct()
|
139 | 141 | [
|
140 | 142 | 'label' => __('Next'),
|
141 | 143 | 'onclick' => 'setLocation(\'' . $this->getUrl(
|
142 |
| - 'review/*/*', |
143 |
| - [ |
144 |
| - 'id' => $nextId, |
145 |
| - 'ret' => $this->getRequest()->getParam('ret'), |
146 |
| - ] |
147 |
| - ) . '\')' |
| 144 | + 'review/*/*', |
| 145 | + [ |
| 146 | + 'id' => $nextId, |
| 147 | + 'ret' => $this->getRequest()->getParam('ret'), |
| 148 | + ] |
| 149 | + ) . '\')' |
148 | 150 | ],
|
149 | 151 | 3,
|
150 | 152 | 105
|
@@ -220,10 +222,13 @@ protected function _construct()
|
220 | 222 | );
|
221 | 223 | }
|
222 | 224 | }
|
223 |
| - Event.observe(window, \'load\', function(){ |
224 |
| - Event.observe($("select_stores"), \'change\', review.updateRating); |
225 |
| - }); |
226 | 225 | ';
|
| 226 | + if (!$this->_storeManager->hasSingleStore()) { |
| 227 | + $this->_formInitScripts[] = 'Event.observe(window, \'load\', function(){ |
| 228 | + Event.observe($("select_stores"), \'change\', review.updateRating); |
| 229 | + }); |
| 230 | + '; |
| 231 | + } |
227 | 232 | }
|
228 | 233 |
|
229 | 234 | /**
|
|
0 commit comments