mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
new linter fixes
This commit is contained in:
parent
23ede59730
commit
509024458d
2 changed files with 44 additions and 42 deletions
|
@ -1,7 +1,9 @@
|
|||
<template>
|
||||
<div class="sn-open-locally-menu">
|
||||
<div v-if="!this.canOpenLocally && (this.attachment.wopi && this.attachment.urls.edit_asset)">
|
||||
<a :href="`${this.attachment.urls.edit_asset}`" target="_blank" class="block whitespace-nowrap rounded px-3 py-2.5 hover:!text-sn-blue hover:no-underline cursor-pointer hover:bg-sn-super-light-grey">
|
||||
<a :href="`${this.attachment.urls.edit_asset}`" target="_blank"
|
||||
class="block whitespace-nowrap rounded px-3 py-2.5
|
||||
hover:!text-sn-blue hover:no-underline cursor-pointer hover:bg-sn-super-light-grey">
|
||||
{{ this.attachment.wopi_context.button_text }}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -19,47 +21,47 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import OpenLocallyMixin from './mixins/open_locally.js'
|
||||
import MenuDropdown from '../../menu_dropdown.vue'
|
||||
import OpenLocallyMixin from './mixins/open_locally.js';
|
||||
import MenuDropdown from '../../menu_dropdown.vue';
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'OpenLocallyMenu',
|
||||
mixins: [OpenLocallyMixin],
|
||||
components: { MenuDropdown },
|
||||
props: {
|
||||
data: { type: String, required: true }
|
||||
data: { type: String, required: true },
|
||||
},
|
||||
created() {
|
||||
window.openLocallyMenu = this;
|
||||
this.attachment = JSON.parse(this.data)
|
||||
this.attachment = JSON.parse(this.data);
|
||||
},
|
||||
beforeUnmount() {
|
||||
delete window.openLocallyMenuComponent;
|
||||
},
|
||||
computed: {
|
||||
menu() {
|
||||
let menu = [];
|
||||
const menu = [];
|
||||
|
||||
if (this.attachment.wopi && this.attachment.urls.edit_asset) {
|
||||
menu.push({
|
||||
text: this.attachment.wopi_context.button_text,
|
||||
url: this.attachment.urls.edit_asset,
|
||||
url_target: '_blank'
|
||||
})
|
||||
url_target: '_blank',
|
||||
}),
|
||||
}
|
||||
if (this.canOpenLocally) {
|
||||
const text = this.localAppName
|
||||
? this.i18n.t('attachments.open_locally_in', { application: this.localAppName })
|
||||
: this.i18n.t('attachments.open_locally')
|
||||
: this.i18n.t('attachments.open_locally');
|
||||
|
||||
menu.push({
|
||||
text: text,
|
||||
emit: 'open_locally'
|
||||
})
|
||||
text,
|
||||
emit: 'open_locally',
|
||||
});
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -46,7 +46,7 @@ const entryList = {
|
|||
vue_components_export_stock_consumption_modal: './app/javascript/packs/vue/export_stock_consumption_modal.js',
|
||||
vue_components_manage_stock_value_modal: './app/javascript/packs/vue/manage_stock_value_modal.js',
|
||||
vue_legacy_datetime_picker: './app/javascript/packs/vue/legacy/datetime_picker.js',
|
||||
vue_open_locally_menu: './app/javascript/packs/vue/open_locally_menu.js'
|
||||
vue_open_locally_menu: './app/javascript/packs/vue/open_locally_menu.js',
|
||||
}
|
||||
|
||||
// Engine pack loading based on https://github.com/rails/webpacker/issues/348#issuecomment-635480949
|
||||
|
|
Loading…
Reference in a new issue