diff --git a/view/adminhtml/web/vue/app.vue b/view/adminhtml/web/vue/app.vue index 0724a3db..aa2280da 100644 --- a/view/adminhtml/web/vue/app.vue +++ b/view/adminhtml/web/vue/app.vue @@ -78,19 +78,19 @@ required: true } }, - data: function() { + data() { return { list: [], selectedItem: null }; }, computed: { - jsonList: function() { + jsonList() { return JSON.stringify(this.list); } }, watch: { - jsonList: function (newValue) { + jsonList (newValue) { this.updateSerializedNodes(newValue) } }, @@ -117,13 +117,13 @@ }, methods: { uuid, - setSelectedNode: function(item) { + setSelectedNode(item) { this.selectedItem = item; }, - removeNode: function(list, index) { + removeNode(list, index) { list.splice(index, 1); }, - addNode: function(target) { + addNode(target) { target.push({ id: this.uuid(), uuid: this.uuid(), diff --git a/view/adminhtml/web/vue/field-type/autocomplete-lazy.vue b/view/adminhtml/web/vue/field-type/autocomplete-lazy.vue index 1fd23ebb..44997000 100644 --- a/view/adminhtml/web/vue/field-type/autocomplete-lazy.vue +++ b/view/adminhtml/web/vue/field-type/autocomplete-lazy.vue @@ -106,7 +106,7 @@ initialLoaded: false }), computed: { - placeholder: function() { + placeholder() { return this.config.translation.pleaseSelect + ' ' + this.label.toLocaleLowerCase(); }, loadedOptions() { diff --git a/view/adminhtml/web/vue/field-type/autocomplete.vue b/view/adminhtml/web/vue/field-type/autocomplete.vue index b6a41044..38dab128 100644 --- a/view/adminhtml/web/vue/field-type/autocomplete.vue +++ b/view/adminhtml/web/vue/field-type/autocomplete.vue @@ -140,10 +140,10 @@ } } }, - placeholder: function() { + placeholder() { return this.config.translation.pleaseSelect + ' ' + this.label.toLocaleLowerCase(); }, - optionsTree: function() { + optionsTree() { const hashTable = {}, optionsTree = []; diff --git a/view/adminhtml/web/vue/field-type/checkbox.vue b/view/adminhtml/web/vue/field-type/checkbox.vue index cb7b7992..19b097b5 100644 --- a/view/adminhtml/web/vue/field-type/checkbox.vue +++ b/view/adminhtml/web/vue/field-type/checkbox.vue @@ -66,18 +66,18 @@ define(["Vue"], function(Vue) { required: true } }, - data: function() { + data() { return { fieldId: '', checkboxValue: this.value === '1' ? true : false } }, watch: { - checkboxValue: function(newValue) { + checkboxValue(newValue) { this.item.is_active = newValue ? '1' : '0'; } }, - mounted: function() { + mounted() { this.fieldId = 'snowmenu_' + this.id + '_' + this._uid; }, template: template diff --git a/view/adminhtml/web/vue/field-type/image-upload.vue b/view/adminhtml/web/vue/field-type/image-upload.vue index c5e04efe..6d42f840 100644 --- a/view/adminhtml/web/vue/field-type/image-upload.vue +++ b/view/adminhtml/web/vue/field-type/image-upload.vue @@ -109,7 +109,7 @@ required: true } }, - data: function() { + data() { return { isDragging: false, fieldId: '', @@ -128,15 +128,15 @@ labelFileIsUploading: $t('Uploading file ...'), } }, - mounted: function() { + mounted() { this.fieldId = 'snowmenu_' + this.id + '_' + this._uid; }, methods: { - setItemImage: function(file, url) { + setItemImage(file, url) { this.item.image = file; this.item.image_url = url; }, - uploadFileToServer: function() { + uploadFileToServer() { this.fileIsUploading = true; var formData = new FormData(); @@ -175,7 +175,7 @@ }); }, - removeItemImage: function(e) { + removeItemImage(e) { e.preventDefault(); if (!this.item.image) { @@ -210,16 +210,16 @@ }); }, - removeNewFile: function() { + removeNewFile() { this.$refs.fileUpload.value = ''; this.previewImage = ''; }, - assignImage: function(e) { + assignImage(e) { this.previewImage = e.target.result; }, - previewUploadImage: function(file) { + previewUploadImage(file) { this.file = file; if (file.type && file.type.indexOf('image') === -1) { @@ -234,28 +234,28 @@ reader.readAsDataURL(file); }, - chooseFile: function(e) { + chooseFile(e) { e.preventDefault(); this.$refs.fileUpload.click() }, - onDragEnter: function(e) { + onDragEnter(e) { e.preventDefault(); this.isDragging = true; }, - onDragLeave: function(e) { + onDragLeave(e) { e.preventDefault(); this.isDragging = false; }, - onDrop: function(e) { + onDrop(e) { e.preventDefault(); e.stopPropagation(); this.previewUploadImage(e.dataTransfer.files[0]) }, - updateFile: function(event){ + updateFile(event){ this.uploadError = ''; this.previewUploadImage(event.target.files[0]); event.preventDefault(); diff --git a/view/adminhtml/web/vue/field-type/simple-field.vue b/view/adminhtml/web/vue/field-type/simple-field.vue index 4fca646a..6dda6088 100644 --- a/view/adminhtml/web/vue/field-type/simple-field.vue +++ b/view/adminhtml/web/vue/field-type/simple-field.vue @@ -41,16 +41,16 @@ default: null } }, - data: function() { + data() { return { fieldId: '' } }, - mounted: function() { + mounted() { this.fieldId = 'snowmenu_' + this.id + '_' + this._uid; }, methods: { - updateValue: function(value) { + updateValue(value) { this.$emit('input', value); } }, diff --git a/view/adminhtml/web/vue/menu-type.vue b/view/adminhtml/web/vue/menu-type.vue index 3386bd64..ec577e58 100644 --- a/view/adminhtml/web/vue/menu-type.vue +++ b/view/adminhtml/web/vue/menu-type.vue @@ -119,7 +119,7 @@ required: true } }, - data: function() { + data() { return { draft: {}, isNodeActiveLabel: $t('Enabled'), @@ -133,7 +133,7 @@ } }, computed: { - isTemplateSectionVisible: function() { + isTemplateSectionVisible() { var nodeId = this.templateList['node'], submenuId = this.templateList['submenu'], typeData = this.config.fieldData[this.item['type']]; @@ -144,7 +144,7 @@ return false; }, - options: function() { + options() { var list = []; for (type in this.config.nodeTypes) { list.push({ @@ -154,15 +154,15 @@ } return list; }, - templateOptions: function() { + templateOptions() { return this.templateOptionsData[this.item['type']] || []; }, - showImage: function() { + showImage() { return ['category', 'product', 'custom_url'].includes(this.item.type); } }, methods: { - changeType: function(selected) { + changeType(selected) { if (selected && typeof selected === 'object') { var type = this.item.type, value = selected.value; @@ -179,7 +179,7 @@ this.item['type'] = value; } }, - getOptionLabel: function(option) { + getOptionLabel(option) { if (typeof option === 'object') { return option.label; } diff --git a/view/adminhtml/web/vue/nested-list.vue b/view/adminhtml/web/vue/nested-list.vue index 1b630fcc..37813283 100644 --- a/view/adminhtml/web/vue/nested-list.vue +++ b/view/adminhtml/web/vue/nested-list.vue @@ -182,44 +182,44 @@ required: true }, }, - data: function() { + data() { return { editItem: false, collapsed: true } }, methods: { - selectedEvent: function(item) { + selectedEvent(item) { if (typeof(this.selected) === 'function') { this.selected(item); } }, - appendEvent: function(list, index) { + appendEvent(list, index) { this.editItem = false; this.collapsed = false; if (typeof(this.append) === 'function') { this.append(list[index].columns); } }, - duplicateEvent: function(list, index) { + duplicateEvent(list, index) { if (typeof(this.duplicate) === 'function') { this.duplicate(list, index); } }, - deleteEvent: function(list, index) { + deleteEvent(list, index) { this.editItem = false; if (typeof(this.delete) === 'function') { this.delete(list, index); } }, - getNodeType: function(type) { + getNodeType(type) { var nodeType = ''; if (type) { nodeType = '(' + this.$root.config.nodeTypes[type] + ')'; } return nodeType; }, - editNode: function() { + editNode() { this.editItem = !this.editItem; this.collapsed = !this.editItem; }