feat: Globale Konstante isReadOnly-Wert erstellt.
- Constraint für ReadOnly-Schaltfläche mit isReadOnly-Wert hinzugefügt
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
}
|
||||
|
||||
static getToolbarItems(instance, handler) {
|
||||
const customItems = UI.getCustomItems(handler)
|
||||
const customItems = UI.getWritableItems(handler)
|
||||
const defaultItems = UI.getDefaultItems(instance.toolbarItems)
|
||||
return defaultItems.concat(customItems)
|
||||
}
|
||||
@@ -73,22 +73,25 @@
|
||||
return el.firstChild
|
||||
}
|
||||
|
||||
static getCustomItems = function (callback) {
|
||||
return [
|
||||
{
|
||||
type: 'custom',
|
||||
id: 'button-share',
|
||||
className: 'button-share',
|
||||
title: 'Teilen',
|
||||
onPress() {
|
||||
callback('SHARE')
|
||||
},
|
||||
icon: `<svg width="30" height="30" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
static getWritableItems = function (callback) {
|
||||
const items = new Array();
|
||||
if (!IS_READONLY)
|
||||
items.push(
|
||||
{
|
||||
type: 'custom',
|
||||
id: 'button-share',
|
||||
className: 'button-share',
|
||||
title: 'Teilen',
|
||||
onPress() {
|
||||
callback('SHARE')
|
||||
},
|
||||
icon: `<svg width="30" height="30" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20 13V17.5C20 20.5577 16 20.5 12 20.5C8 20.5 4 20.5577 4 17.5V13M12 3L12 15M12 3L16 7M12 3L8 7" stroke="#000000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>`,
|
||||
}
|
||||
]
|
||||
return [
|
||||
}
|
||||
);
|
||||
|
||||
var otherItmes = [
|
||||
{
|
||||
type: 'custom',
|
||||
id: 'button-reset',
|
||||
@@ -124,6 +127,8 @@
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
static getDefaultItems(items) {
|
||||
|
||||
Reference in New Issue
Block a user