Skip to content

Commit

Permalink
Fix ESLint in oh-grid-layout/oh-grid-item
Browse files Browse the repository at this point in the history
Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys committed Mar 9, 2021
1 parent 68d34a0 commit 6c32655
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<template>
<grid-item v-bind="$attrs" v-if="visible" class="oh-grid-item card no-margin" @moved="movedEvent" @resized="resizedEvent" dragAllowFrom=".drag-handle">
<template v-if="context.editmode">
<f7-link :popover-open="'.item-popover-' + _uid" class="configure-item-menu"><f7-icon f7="gear_alt"></f7-icon></f7-link>
<f7-link :popover-open="'.item-popover-' + _uid" class="configure-item-menu">
<f7-icon f7="gear_alt" />
</f7-link>
<f7-popover :class="'item-popover-' + _uid" ref="popover" :backdrop="false" :style="{ width: context.component.slots.default.length > 0 ? '208px' : '76px' }" :animate="false">
<div class="display-flex margin justify-content-center">
<f7-link href="#" v-if="context.component.slots.default.length > 0" class="text-color-blue display-flex flex-direction-column margin-right" :popover-close="'.item-popover-' + _uid" @click="$refs.popover.f7Popover.close(false); context.editmode.configureWidget(context.component.slots.default[0], context)" icon-f7="square_pencil">Configure</f7-link>
<f7-link href="#" v-if="context.component.slots.default.length > 0" class="text-color-blue display-flex flex-direction-column margin-right" :popover-close="'.item-popover-' + _uid" @click="$refs.popover.f7Popover.close(false); context.editmode.editWidgetCode(context.component.slots.default[0], context)" icon-f7="doc_text">YAML</f7-link>
<f7-link href="#" class="text-color-red display-flex flex-direction-column" @click="$refs.popover.f7Popover.close(false); context.editmode.removeWidget(context.component, context.parent, 'grid')" icon-f7="trash">Remove</f7-link>
<f7-link href="#" v-if="context.component.slots.default.length > 0" class="text-color-blue display-flex flex-direction-column margin-right" :popover-close="'.item-popover-' + _uid" @click="$refs.popover.f7Popover.close(false); context.editmode.configureWidget(context.component.slots.default[0], context)" icon-f7="square_pencil">
Configure
</f7-link>
<f7-link href="#" v-if="context.component.slots.default.length > 0" class="text-color-blue display-flex flex-direction-column margin-right" :popover-close="'.item-popover-' + _uid" @click="$refs.popover.f7Popover.close(false); context.editmode.editWidgetCode(context.component.slots.default[0], context)" icon-f7="doc_text">
YAML
</f7-link>
<f7-link href="#" class="text-color-red display-flex flex-direction-column" @click="$refs.popover.f7Popover.close(false); context.editmode.removeWidget(context.component, context.parent, 'grid')" icon-f7="trash">
Remove
</f7-link>
</div>
</f7-popover>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,29 @@
<f7-menu-item @click="addItem" icon-f7="plus" text="Add Widget" />
<f7-menu-item style="margin-left: auto" icon-f7="grid" dropdown>
<f7-menu-dropdown right>
<f7-menu-dropdown-item @click="context.editmode.configureWidget(context.component, context.parent, 'oh-grid-layout')" href="#" text="Configure Grid Layout"></f7-menu-dropdown-item>
<f7-menu-dropdown-item @click="context.editmode.configureWidget(context.component, context.parent, 'oh-grid-layout')" href="#" text="Configure Grid Layout" />
</f7-menu-dropdown>
</f7-menu-item>
</f7-menu>
<hr />
<hr>
</f7-block>

<!-- fullscreen fab menu -->
<template v-if="fullscreen">
<f7-fab-backdrop></f7-fab-backdrop>
<f7-fab-backdrop />
<f7-fab v-if="context.editmode" position="right-bottom" color="blue">
<f7-icon f7="menu" />
<f7-icon ios="f7:xmark" aurora="f7:xmark" md="material:close" />
<f7-fab-buttons position="top">
<f7-fab-button label="Exit Fullscreen" fab-close @click="exitFullscreen"><f7-icon size="20" f7="rectangle_arrow_up_right_arrow_down_left_slash" /></f7-fab-button>
<f7-fab-button label="Configure Grid Layout" fab-close @click="context.editmode.configureWidget(context.component, context.parent, 'oh-grid-layout')"><f7-icon size="20" f7="square_pencil" /></f7-fab-button>
<f7-fab-button label="Add Widget" fab-close @click="addItem"><f7-icon size="20" f7="plus" /></f7-fab-button>
<f7-fab-button label="Exit Fullscreen" fab-close @click="exitFullscreen">
<f7-icon size="20" f7="rectangle_arrow_up_right_arrow_down_left_slash" />
</f7-fab-button>
<f7-fab-button label="Configure Grid Layout" fab-close @click="context.editmode.configureWidget(context.component, context.parent, 'oh-grid-layout')">
<f7-icon size="20" f7="square_pencil" />
</f7-fab-button>
<f7-fab-button label="Add Widget" fab-close @click="addItem">
<f7-icon size="20" f7="plus" />
</f7-fab-button>
</f7-fab-buttons>
</f7-fab>
</template>
Expand All @@ -50,7 +56,8 @@
}"
:use-css-transforms="false"
>
<div v-if="context.editmode" style="opacity: 0.3; padding: 4px; user-select: none;">{{ getCurrentScreenResolution() }}
<div v-if="context.editmode" style="opacity: 0.3; padding: 4px; user-select: none;">
{{ getCurrentScreenResolution() }}
<span v-if="isRetina()"><f7-icon tooltip="Screen resolution shown is the fullscreen resolution for websites. Real screen resolution is bigger." f7="info_circle" /></span>
</div>
<oh-grid-item
Expand All @@ -61,7 +68,8 @@
:h="item.h"
:i="item.i"
:key="item.i"
:context="childContext(context.component.slots.grid[item.i])" />
:context="childContext(context.component.slots.grid[item.i])"
/>
</grid-layout>
</div>
</template>
Expand Down

0 comments on commit 6c32655

Please sign in to comment.