Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/RowSelection/jQuery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="demo-container">
<div id="gridContainer"></div>
<div id="employeeInfo">
<img class="employeePhoto hidden" alt="Employee photo" />
<img class="employeePhoto" alt="Employee photo" style="visibility: hidden" />
<p class="employeeNotes"></p>
</div>
</div>
Expand Down
5 changes: 1 addition & 4 deletions apps/demos/Demos/DataGrid/RowSelection/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ $(() => {
const data = selectedItems.selectedRowsData[0];
if (data) {
$('.employeeNotes').text(data.Notes);
$('.employeePhoto').attr('src', data.Picture).removeClass('hidden');
} else {
$('.employeeNotes').text('');
$('.employeePhoto').addClass('hidden');
$('.employeePhoto').attr('src', data.Picture).attr('style', null);
}
},
});
Expand Down
4 changes: 0 additions & 4 deletions apps/demos/Demos/DataGrid/RowSelection/jQuery/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
padding: 20px;
}

#employeeInfo .employeePhoto.hidden {
visibility: hidden;
}

#employeeInfo .employeeNotes {
padding-top: 20px;
text-align: justify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
::ng-deep .img {
height: 50px;
width: 50px;
object-fit: contain;
margin-right: 10px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
border-radius: 25px;
border: 1px solid lightgray;
background-color: #fff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@
></dxi-tree-list-column>
<div *dxTemplate="let options of 'employeeTemplate'">
@if(options.data.Task_Assigned_Employee) {
<img
<div
class="img"
[src]="options.data.Task_Assigned_Employee.Picture"
alt=""
/>
style.background-image="url('{{
options.data.Task_Assigned_Employee.Picture
}}')"
></div>
} @if(options.data.Task_Assigned_Employee) {
<span class="name">{{ options.data.Task_Assigned_Employee.Name }}</span>
}
Expand Down
6 changes: 1 addition & 5 deletions apps/demos/Demos/TreeList/Overview/React/EmployeeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ const EmployeeCell = (props: TreeListTypes.ColumnCellTemplateData) => {

return (
<>
<img
className="img"
src={employee.Picture}
alt=""
/>
<div className="img" style={{ backgroundImage: `url(${employee.Picture})` }} />
&nbsp;
<span className="name">{employee.Name}</span>
</>
Expand Down
4 changes: 3 additions & 1 deletion apps/demos/Demos/TreeList/Overview/React/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
.img {
height: 50px;
width: 50px;
object-fit: contain;
margin-right: 10px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
border-radius: 25px;
border: 1px solid lightgray;
background-color: #fff;
Expand Down
5 changes: 2 additions & 3 deletions apps/demos/Demos/TreeList/Overview/ReactJs/EmployeeCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ const EmployeeCell = (props) => {
}
return (
<>
<img
<div
className="img"
src={employee.Picture}
alt=""
style={{ backgroundImage: `url(${employee.Picture})` }}
/>
&nbsp;
<span className="name">{employee.Name}</span>
Expand Down
4 changes: 3 additions & 1 deletion apps/demos/Demos/TreeList/Overview/ReactJs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
.img {
height: 50px;
width: 50px;
object-fit: contain;
margin-right: 10px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
border-radius: 25px;
border: 1px solid lightgray;
background-color: #fff;
Expand Down
9 changes: 5 additions & 4 deletions apps/demos/Demos/TreeList/Overview/Vue/EmployeeCell.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<template>
<div>
<img
<div
v-if="cellData.Task_Assigned_Employee"
:src="cellData.Task_Assigned_Employee.Picture"
alt=""
:style="'background-image:url(' + cellData.Task_Assigned_Employee.Picture + ')'"
class="img"
/>
<span
Expand All @@ -29,8 +28,10 @@ withDefaults(defineProps<{
.img {
height: 50px;
width: 50px;
object-fit: contain;
margin-right: 14px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
border-radius: 25px;
border: 1px solid lightgray;
background-color: #fff;
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/TreeList/Overview/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $(() => {
const currentEmployee = options.data.Task_Assigned_Employee;
if (currentEmployee) {
container
.append($('<img>', { class: 'img', src: currentEmployee.Picture, alt: '' }))
.append($('<div>', { class: 'img', style: `background-image:url(${currentEmployee.Picture});` }))
.append('\n')
.append($('<span>', { class: 'name', text: currentEmployee.Name }));
}
Expand Down
4 changes: 3 additions & 1 deletion apps/demos/Demos/TreeList/Overview/jQuery/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
.img {
height: 50px;
width: 50px;
object-fit: contain;
margin-right: 10px;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
border-radius: 25px;
border: 1px solid lightgray;
background-color: #fff;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions apps/demos/utils/server/csp-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ const CSP_DEMO_ALLOWLIST = {
},
'TreeList/Overview': {
'img-src': ['data:'],
// TODO: fix inline style in cellTemplate (background-image)
'style-src': ["'unsafe-inline'"],
},
// globalize/message.js uses new Function() internally
'Localization/UsingGlobalize': {
Expand All @@ -186,6 +188,10 @@ const CSP_DEMO_ALLOWLIST = {
'HtmlEditor/MarkdownSupport': {
'script-src': ["'unsafe-inline'"],
},
// TODO: fix inline style attribute
'DataGrid/RowSelection': {
'style-src': ["'unsafe-inline'"],
},
// AI demo: inline <script type="module"> to import OpenAI SDK from esm.sh
'Chat/AIAndChatbotIntegration': {
'script-src': ["'unsafe-inline'"],
Expand Down
Loading