Fix Bug 48186 addition
This commit is contained in:
parent
3c05927fbc
commit
c51221e46e
|
@ -484,7 +484,6 @@
|
||||||
.row {
|
.row {
|
||||||
&, li {
|
&, li {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
padding-left: 5px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -500,6 +499,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#edit-table-style {
|
||||||
|
.list ul ul {
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cell styles
|
// Cell styles
|
||||||
|
|
||||||
.cell-styles-list {
|
.cell-styles-list {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
.dataview {
|
.dataview {
|
||||||
.row {
|
.row {
|
||||||
justify-content: flex-start;
|
justify-content: space-around;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
|
|
|
@ -7,22 +7,11 @@ import {CustomColorPicker, ThemeColorPalette} from "../../../../../common/mobile
|
||||||
|
|
||||||
// Style
|
// Style
|
||||||
|
|
||||||
const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyleClick, storeFocusObjects}) => {
|
const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer(({onStyleClick,storeTableSettings,storeFocusObjects}) => {
|
||||||
const tableObject = storeFocusObjects.tableObject;
|
const tableObject = storeFocusObjects.tableObject;
|
||||||
const styleId = tableObject ? tableObject.get_TableStyle() : null;
|
const styleId = tableObject ? tableObject.get_TableStyle() : null;
|
||||||
const [stateId, setId] = useState(styleId);
|
const [stateId, setId] = useState(styleId);
|
||||||
|
const styles = storeTableSettings.styles;
|
||||||
const widthContainer = document.querySelector(".page-content").clientWidth;
|
|
||||||
const columns = parseInt((widthContainer - 47) / 70); // magic
|
|
||||||
const styles = [];
|
|
||||||
let row = -1;
|
|
||||||
templates.forEach((style, index) => {
|
|
||||||
if (0 == index % columns) {
|
|
||||||
styles.push([]);
|
|
||||||
row++
|
|
||||||
}
|
|
||||||
styles[row].push(style);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!tableObject && Device.phone) {
|
if (!tableObject && Device.phone) {
|
||||||
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
$$('.sheet-modal.modal-in').length > 0 && f7.sheet.close();
|
||||||
|
@ -31,21 +20,17 @@ const StyleTemplates = inject("storeFocusObjects")(observer(({templates, onStyle
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="dataview table-styles">
|
<div className="dataview table-styles">
|
||||||
{styles.map((row, rowIndex) => {
|
<ul className="row">
|
||||||
return (
|
{styles.map((style, index) => {
|
||||||
<div className="row" key={`row-${rowIndex}`}>
|
return (
|
||||||
{row.map((style, index)=>{
|
<li key={index}
|
||||||
return(
|
className={style.templateId === stateId ? 'active' : ''}
|
||||||
<div key={`${rowIndex}-${index}`}
|
onClick={() => {onStyleClick(style.templateId); setId(style.templateId)}}>
|
||||||
className={style.templateId === stateId ? 'active' : ''}
|
<img src={style.imageUrl}/>
|
||||||
onClick={() => {onStyleClick(style.templateId); setId(style.templateId)}}>
|
</li>
|
||||||
<img src={style.imageUrl} />
|
)
|
||||||
</div>
|
})}
|
||||||
)
|
</ul>
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue