Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove delete buttons and other actions if contact is not readable #1413

Merged
Merged
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
7 changes: 6 additions & 1 deletion css/Properties/Properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
$property-label-min-width: 60px;
$property-label-max-width: 2 * $property-label-min-width;
$property-value-max-width: 250px;
$property-ext-padding-right: 8px;

.property {
position: relative;
Expand Down Expand Up @@ -170,7 +171,7 @@ $property-value-max-width: 250px;
&__ext {
position: absolute;
// 8px padding + actions
right: 44px + 8px;
right: 44px + $property-ext-padding-right;
opacity: 0;
&:hover,
&:focus,
Expand All @@ -179,6 +180,10 @@ $property-value-max-width: 250px;
}
}

.no-move {
right: $property-ext-padding-right;
}

// Delete property button + actions
&__actions {
z-index: 10;
Expand Down
15 changes: 13 additions & 2 deletions src/components/Properties/PropertyDateTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
</div>

<!-- Real input where the picker shows -->
<DatetimePicker :value="vcardTimeLocalValue.toJSDate()"
<DatetimePicker
v-if="!isReadOnly"
:value="vcardTimeLocalValue.toJSDate()"
:minute-step="10"
:lang="lang"
:clearable="false"
Expand All @@ -64,8 +66,17 @@
confirm
@confirm="debounceUpdateValue" />

<input v-else
:readonly="true"
:value="formatDateTime()"
class="property__value">

<!-- props actions -->
<PropertyActions :actions="actions" :property-component="this" @delete="deleteProperty" />
<PropertyActions
v-if="!isReadOnly"
:actions="actions"
:property-component="this"
@delete="deleteProperty" />
</div>
</div>
</template>
Expand Down
1 change: 1 addition & 0 deletions src/components/Properties/PropertyMultipleText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

<!-- props actions -->
<PropertyActions class="property__actions--floating"
v-if="!isReadOnly"
:actions="actions"
:property-component="this"
@delete="deleteProperty" />
Expand Down
6 changes: 5 additions & 1 deletion src/components/Properties/PropertySelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
@input="updateValue" />

<!-- props actions -->
<PropertyActions :actions="actions" :property-component="this" @delete="deleteProperty" />
<PropertyActions
v-if="!isReadOnly"
:actions="actions"
:property-component="this"
@delete="deleteProperty" />
</div>
</div>
</template>
Expand Down
8 changes: 6 additions & 2 deletions src/components/Properties/PropertyText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,15 @@
<!-- external link -->
<a v-if="haveExtHandler"
:href="externalHandler"
class="property__ext icon-external"
:class="{'property__ext': true, 'icon-external': true, 'no-move': isReadOnly}"
target="_blank" />

<!-- props actions -->
<PropertyActions :actions="actions" :property-component="this" @delete="deleteProperty" />
<PropertyActions
v-if="!isReadOnly"
:actions="actions"
:property-component="this"
@delete="deleteProperty" />
</div>
</div>
</template>
Expand Down