--- a/src/pyams_content/component/paragraph/zmi/keynumber.py Thu Apr 05 23:05:37 2018 +0200
+++ b/src/pyams_content/component/paragraph/zmi/keynumber.py Fri Apr 06 08:19:43 2018 +0200
@@ -42,7 +42,7 @@
from pyams_form.security import ProtectedFormObjectMixin
from pyams_i18n.column import I18nAttrColumn
from pyams_pagelet.pagelet import pagelet_config
-from pyams_skin.container import set_element_visibility
+from pyams_skin.container import switch_element_visibility
from pyams_skin.table import BaseTable, SorterColumn, I18nColumn, VisibilitySwitcherColumn, TrashColumn
from pyams_skin.viewlet.toolbar import ToolbarAction
from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter
@@ -211,7 +211,7 @@
'data-ams-location': absolute_url(IKeyNumberContainer(self.context), self.request),
'data-ams-tablednd-drag-handle': 'td.sorter',
'data-ams-tablednd-drop-target': 'set-keynumbers-order.json',
- 'data-ams-visibility-target': 'set-keynumber-visibility.json'
+ 'data-ams-visibility-target': 'switch-keynumber-visibility.json'
}
attributes.setdefault('tr', {}).update({
'id': lambda x, col: 'keynumber_{0}::{1}'.format(get_parent(x, IKeyNumberContainerTarget).__name__,
@@ -254,11 +254,11 @@
"""Key numbers container visibility switcher column"""
-@view_config(name='set-keynumber-visibility.json', context=IKeyNumberContainer, request_type=IPyAMSLayer,
+@view_config(name='switch-keynumber-visibility.json', context=IKeyNumberContainer, request_type=IPyAMSLayer,
permission=MANAGE_CONTENT_PERMISSION, renderer='json', xhr=True)
def set_keynumber_visibility(request):
"""Set key number visibility"""
- return set_element_visibility(request, IKeyNumberContainer)
+ return switch_element_visibility(request, IKeyNumberContainer)
@adapter_config(name='name', context=(IKeyNumberContainerTarget, IPyAMSLayer, KeyNumbersTable), provides=IColumn)