First commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
import button from "/elements/button.js";
|
||||
|
||||
import groups from '/user/group/user.group.permission.js';
|
||||
|
||||
export default class deleteButton extends button {
|
||||
|
||||
text = "Delete";
|
||||
|
||||
propegateEvent = false;
|
||||
|
||||
|
||||
async click() {
|
||||
|
||||
var sure = confirm("Are you sure you want to delete this item");
|
||||
|
||||
if( sure ) {
|
||||
|
||||
await this.parent.parent.delete();
|
||||
|
||||
this.parent.parent.remove();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
permission() {
|
||||
|
||||
this.allow( groups.admin, "DELETE" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
23
application/demo/list/item/news.list.item.actions.js
Normal file
23
application/demo/list/item/news.list.item.actions.js
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
import gridViewColumn from '/elements/gridView/gridView.body.row.column.js';
|
||||
|
||||
import deleteButton from "./news.list.item.actions.deleteButton.js"
|
||||
|
||||
|
||||
export default class newsListItemActions extends gridViewColumn, gridViewColumn{
|
||||
|
||||
useCustomElement = false;
|
||||
|
||||
padding = 20;
|
||||
|
||||
display = "table-cell";
|
||||
|
||||
layers = 1;
|
||||
|
||||
paddingLeft = 30;
|
||||
|
||||
borderRadius;
|
||||
|
||||
deleteButton = new deleteButton();
|
||||
|
||||
}
|
||||
9
application/demo/list/item/news.list.item.body.js
Normal file
9
application/demo/list/item/news.list.item.body.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
import newsBody from '../../news.body.js';
|
||||
|
||||
import gridViewColumn from '/elements/gridView/gridView.body.row.column.js';
|
||||
|
||||
export default class newsListItemBody extends newsBody, gridViewColumn{
|
||||
|
||||
|
||||
}
|
||||
123
application/demo/list/item/news.list.item.js
Normal file
123
application/demo/list/item/news.list.item.js
Normal file
@@ -0,0 +1,123 @@
|
||||
import news from '../../news.js';
|
||||
|
||||
import body from './news.list.item.body.js';
|
||||
|
||||
import title from './news.list.item.title.js';
|
||||
|
||||
import price from './news.list.item.price.js';
|
||||
|
||||
import actions from './news.list.item.actions.js';
|
||||
|
||||
import groups from '/user/group/user.group.permission.js';
|
||||
|
||||
import gridViewRow from '/elements/gridView/gridView.body.row.js';
|
||||
|
||||
export default class newsListItem extends news, gridViewRow {
|
||||
|
||||
body = new body();
|
||||
|
||||
title = new title();
|
||||
|
||||
price = new price();
|
||||
|
||||
actions = new actions();
|
||||
|
||||
cursor = "pointer";
|
||||
|
||||
background;
|
||||
|
||||
#ifdef MACOS
|
||||
|
||||
fontSize = 14;
|
||||
|
||||
#endif
|
||||
|
||||
hoverBackgroundColor = "#363333"
|
||||
|
||||
#ifdef DARK
|
||||
|
||||
//mouseHoverColor = "#363333";
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef LIGHT
|
||||
|
||||
//mouseHoverColor = "rgb(255 255 255 / 95%)";
|
||||
|
||||
#endif
|
||||
|
||||
async click() {
|
||||
|
||||
this.stateMachine.composeState( this.id, this.value );
|
||||
|
||||
await this.loadPage( this.id );
|
||||
|
||||
}
|
||||
|
||||
state async loadPage( id ) {
|
||||
|
||||
var rightSide = this.parents("newsPages");
|
||||
|
||||
var boundBox = this.defaultElement.getBoundingClientRect();
|
||||
|
||||
var width = boundBox.width;
|
||||
|
||||
|
||||
#ifdef ANDROID
|
||||
|
||||
rightSide.newsItemPage.translateX = -width;
|
||||
|
||||
#elif
|
||||
|
||||
rightSide.newsItemPage.transform = "translateX(-600px)";
|
||||
|
||||
rightSide.newsPage.transform = "translateX(-600px)";
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
var newsPage = rightSide.newsPage;
|
||||
|
||||
newsPage.id = this.id;
|
||||
|
||||
await newsPage.sync();
|
||||
|
||||
newsPage.createComment.create();
|
||||
|
||||
//newsPage.updateFrostglass();
|
||||
|
||||
//newsPage.show();
|
||||
|
||||
}
|
||||
|
||||
mouseover() {
|
||||
|
||||
//this.background = this.mouseHoverColor;
|
||||
|
||||
}
|
||||
|
||||
mouseleave() {
|
||||
|
||||
//this.background = "none";
|
||||
|
||||
}
|
||||
|
||||
enableDELETE() {
|
||||
|
||||
this.actions.show();
|
||||
|
||||
}
|
||||
|
||||
disableDELETE() {
|
||||
|
||||
this.actions.hide();
|
||||
|
||||
}
|
||||
|
||||
permission() {
|
||||
|
||||
this.allow( groups.admin, "DELETE" );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
20
application/demo/list/item/news.list.item.price.js
Normal file
20
application/demo/list/item/news.list.item.price.js
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
import newsPrice from '../../news.price.js';
|
||||
|
||||
import gridViewColumn from '/elements/gridView/gridView.body.row.column.js';
|
||||
|
||||
|
||||
export default class newsListItemPrice extends newsPrice, gridViewColumn{
|
||||
|
||||
create() {
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
style: 'currency',
|
||||
currency: 'EUR',
|
||||
});
|
||||
|
||||
this.text = formatter.format( this.value );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
10
application/demo/list/item/news.list.item.title.js
Normal file
10
application/demo/list/item/news.list.item.title.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import newsTitle from '../../news.title.js';
|
||||
|
||||
import gridViewColumn from '/elements/gridView/gridView.body.row.column.js';
|
||||
|
||||
|
||||
export default class newsListItemTitle extends newsTitle, gridViewColumn{
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user