File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
public/js/scripts/fieldType
views/themes/admin/ui/field_type/edit Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 87
87
const itemNodeNameCell = itemNode . querySelector ( '.ibexa-relations__item-name' ) ;
88
88
89
89
itemNode . dataset . contentId = contentId ;
90
+ itemNode . dataset . locationId = locationId ;
90
91
itemNode . querySelector ( '.ibexa-relations__table-action--remove-item' ) . addEventListener ( 'click' , removeItem , false ) ;
91
92
92
93
itemNodeNameCell . dataset . ibexaUpdateContentId = contentId ;
128
129
} ;
129
130
const openUDW = ( event ) => {
130
131
event . preventDefault ( ) ;
131
-
132
+ const selectedItemsRow = fieldContainer . querySelectorAll ( SELECTOR_ROW ) ;
132
133
const config = JSON . parse ( event . currentTarget . dataset . udwConfig ) ;
133
134
const limit = parseInt ( event . currentTarget . dataset . limit , 10 ) ;
135
+ const selectedLocations = [ ...selectedItemsRow ] . reduce ( ( locationsIds , selectedItemRow ) => {
136
+ const { locationId } = selectedItemRow . dataset ;
137
+ const parsedLocationId = parseInt ( locationId , 10 ) ;
138
+
139
+ return isNaN ( parsedLocationId ) ? locationsIds : [ ...locationsIds , parsedLocationId ] ;
140
+ } , [ ] ) ;
134
141
const title =
135
142
limit === 1
136
143
? Translator . trans (
151
158
onCancel : closeUDW ,
152
159
title,
153
160
startingLocationId,
161
+ selectedLocations,
154
162
...config ,
155
163
multiple : isSingle ? false : selectedItemsLimit !== 1 ,
156
164
multipleItemsLimit : selectedItemsLimit > 1 ? selectedItemsLimit - selectedItems . length : selectedItemsLimit ,
Original file line number Diff line number Diff line change 170
170
{% set body_rows = body_rows | merge ([{
171
171
cols : body_row_cols ,
172
172
class : ' ibexa-relations__item' ,
173
- attr : { ' data-content-id' : relation .contentInfo .id },
173
+ attr : {
174
+ ' data-content-id' : relation .contentInfo .id ,
175
+ ' data-location-id' : relation .contentInfo .mainLocationId ,
176
+ },
174
177
}]) %}
175
178
{% elseif relation .unauthorized %}
176
179
{% set col_raw_unauthorised %}
194
197
{ content : col_raw_order_input , raw : true , attr : { class : ' ibexa-relations__order-wrapper' } }
195
198
],
196
199
class : ' ibexa-relations__item' ,
197
- attr : { ' data-content-id' : relation .contentId },
200
+ attr : {
201
+ ' data-content-id' : relation .contentId ,
202
+ ' data-location-id' : relation .contentInfo .mainLocationId ,
203
+ },
198
204
}]) %}
199
205
{% endif %}
200
206
{% endfor %}
You can’t perform that action at this time.
0 commit comments