Skip to content

Commit fe98438

Browse files
committed
Fix #14913 - bookmark views become uneditable after deleting the first bookmark view
1 parent 3e23510 commit fe98438

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/bookmarks.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
<span class="admin__action-dropdown-text" translate="activeView.label"/>
1010
</button>
1111
<ul class="admin__action-dropdown-menu">
12-
<repeat args="foreach: viewsArray, item: '$view'">
13-
<li css="_edit: isEditing($view().index)" outerClick="endEdit.bind($data, $view().index)" template="viewTmpl"/>
14-
</repeat>
12+
<!-- ko foreach: { data: viewsArray, as: '$view'} -->
13+
<li css="_edit: $parent.isEditing($view.index)" outerClick="$parent.endEdit.bind($parent, $view.index)" template="$parent.viewTmpl"/>
14+
<!-- /ko -->
1515
<li visible="hasChanges" outerClick="hideCustom.bind($data)"
1616
css="
1717
_edit: customVisible,

app/code/Magento/Ui/view/base/web/templates/grid/controls/bookmarks/view.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@
44
* See COPYING.txt for license details.
55
*/
66
-->
7-
<div class="action-dropdown-menu-item-edit" if="$view().editable">
7+
<div class="action-dropdown-menu-item-edit" if="$view.editable">
88
<input
99
class="admin__control-text"
1010
data-bind="
11-
value: $view().value,
12-
hasFocus: isEditing($view().index),
11+
value: $view.value,
12+
hasFocus: $parent.isEditing($view.index),
1313
autoselect,
1414
attr: {
15-
placeholder: $view().label
15+
placeholder: $view.label
1616
},
1717
keyboard: {
18-
13: updateAndSave.bind($data, $view().index),
19-
27: endEdit.bind($data, $view().index)
18+
13: $parent.updateAndSave.bind($parent, $view.index),
19+
27: $parent.endEdit.bind($parent, $view.index)
2020
}"
2121
type="text">
22-
<button class="action-submit" type="button" attr="title: $t('Save all changes')" click="updateAndSave.bind($data, $view().index)">
22+
<button class="action-submit" type="button" attr="title: $t('Save all changes')" click="$parent.updateAndSave.bind($parent, $view.index)">
2323
<span translate="'Submit'"/>
2424
</button>
2525
<div class="action-dropdown-menu-item-actions">
26-
<button class="action-delete" type="button" attr="title: $t('Delete bookmark')" click="removeView.bind($data, $view().index)">
26+
<button class="action-delete" type="button" attr="title: $t('Delete bookmark')" click="$parent.removeView.bind($parent, $view.index)">
2727
<span translate="'Delete'"/>
2828
</button>
2929
</div>
3030
</div>
3131

3232
<div class="action-dropdown-menu-item">
33-
<a href="" class="action-dropdown-menu-link" translate="$view().label" click="applyView.bind($data, $view().index)" closeCollapsible/>
33+
<a href="" class="action-dropdown-menu-link" translate="$view.label" click="$parent.applyView.bind($parent, $view.index)" closeCollapsible/>
3434

35-
<div class="action-dropdown-menu-item-actions" if="$view().editable">
36-
<button class="action-edit" type="button" attr="title: $t('Edit bookmark')" click="editView.bind($data, $view().index)">
35+
<div class="action-dropdown-menu-item-actions" if="$view.editable">
36+
<button class="action-edit" type="button" attr="title: $t('Edit bookmark')" click="$parent.editView.bind($parent, $view.index)">
3737
<span translate="'Edit'"/>
3838
</button>
3939
</div>

0 commit comments

Comments
 (0)