diff --git a/changelog.d/user_profile_edit.change b/changelog.d/user_profile_edit.change deleted file mode 100644 index dd2260260..000000000 --- a/changelog.d/user_profile_edit.change +++ /dev/null @@ -1 +0,0 @@ -Profile editing change overhaul diff --git a/src/App.scss b/src/App.scss index 51f2c9af3..64c8b8b82 100644 --- a/src/App.scss +++ b/src/App.scss @@ -782,6 +782,12 @@ option { color: var(--text); } +.visibility-notice { + padding: 0.5em; + border: 1px solid var(--textFaint); + border-radius: var(--roundness); +} + .notice-dismissible { padding-right: 4rem; position: relative; diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue index cc00a735d..be281c5ae 100644 --- a/src/components/account_actions/account_actions.vue +++ b/src/components/account_actions/account_actions.vue @@ -139,9 +139,9 @@ diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js index f6ba6e245..f3b6dfe9b 100644 --- a/src/components/emoji_input/emoji_input.js +++ b/src/components/emoji_input/emoji_input.js @@ -205,6 +205,12 @@ const EmojiInput = { return emoji.displayText } }, + onInputScroll () { + this.$refs.hiddenOverlay.scrollTo({ + top: this.input.scrollTop, + left: this.input.scrollLeft + }) + }, suggestionListId () { return `suggestions-${this.randomSeed}` }, @@ -233,6 +239,7 @@ const EmojiInput = { this.overlayStyle.fontSize = style.fontSize this.overlayStyle.wordWrap = style.wordWrap this.overlayStyle.whiteSpace = style.whiteSpace + this.resize() input.addEventListener('blur', this.onBlur) input.addEventListener('focus', this.onFocus) input.addEventListener('paste', this.onPaste) @@ -295,13 +302,6 @@ const EmojiInput = { } }, methods: { - onInputScroll (e) { - this.$refs.hiddenOverlay.scrollTo({ - top: this.input.scrollTop, - left: this.input.scrollLeft - }) - this.setCaret(e) - }, triggerShowPicker () { this.$nextTick(() => { this.$refs.picker.showPicker() @@ -561,6 +561,8 @@ const EmojiInput = { this.$refs.suggestorPopover.updateStyles() }) }, + resize () { + }, autoCompleteItemLabel (suggestion) { if (suggestion.user) { return suggestion.displayText + ' ' + suggestion.detailText diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue index 057e6aa5c..f9788d874 100644 --- a/src/components/emoji_input/emoji_input.vue +++ b/src/components/emoji_input/emoji_input.vue @@ -115,7 +115,6 @@ display: flex; flex-direction: column; position: relative; - display: flex; .emoji-picker-icon { position: absolute; @@ -124,7 +123,7 @@ margin: 0.2em 0.25em; font-size: 1.3em; cursor: pointer; - line-height: 1.2em; + line-height: 24px; &:hover i { color: var(--text); @@ -134,7 +133,7 @@ .emoji-picker-panel { position: absolute; z-index: 20; - margin-top: 0.2em; + margin-top: 2px; &.hide { display: none; @@ -153,7 +152,7 @@ } &.with-picker input { - padding-right: 2em; + padding-right: 30px; } .hidden-overlay { @@ -216,8 +215,8 @@ } .detailText { - font-size: 0.6em; - line-height: 0.6em; + font-size: 9px; + line-height: 9px; } } } diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js index 32b615265..3cb4f6fd1 100644 --- a/src/components/image_cropper/image_cropper.js +++ b/src/components/image_cropper/image_cropper.js @@ -10,6 +10,14 @@ library.add( const ImageCropper = { props: { + trigger: { + type: [String, window.Element], + required: true + }, + submitHandler: { + type: Function, + required: true + }, mimes: { type: String, default: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon' @@ -22,9 +30,6 @@ const ImageCropper = { }, cancelButtonLabel: { type: String - }, - aspectRatio: { - type: Number } }, data () { @@ -34,7 +39,17 @@ const ImageCropper = { submitting: false } }, - emits: ['submit'], + computed: { + saveText () { + return this.saveButtonLabel || this.$t('image_cropper.save') + }, + saveWithoutCroppingText () { + return this.saveWithoutCroppingButtonlabel || this.$t('image_cropper.save_without_cropping') + }, + cancelText () { + return this.cancelButtonLabel || this.$t('image_cropper.cancel') + } + }, methods: { destroy () { this.$refs.input.value = '' @@ -50,15 +65,20 @@ const ImageCropper = { } else { cropperPromise = Promise.resolve() } - cropperPromise.then(canvas => { - this.$emit('submit', { canvas, file: this.file }) - this.submitting = false + this.submitHandler(canvas, this.file) + .then(() => this.destroy()) + .finally(() => { + this.submitting = false + }) }) }, pickImage () { this.$refs.input.click() }, + getTriggerDOM () { + return typeof this.trigger === 'object' ? this.trigger : document.querySelector(this.trigger) + }, readFile () { const fileInput = this.$refs.input if (fileInput.files != null && fileInput.files[0] != null) { @@ -97,11 +117,23 @@ const ImageCropper = { } }, mounted () { + // listen for click event on trigger + const trigger = this.getTriggerDOM() + if (!trigger) { + this.$emit('error', 'No image make trigger found.', 'user') + } else { + trigger.addEventListener('click', this.pickImage) + } // listen for input file changes const fileInput = this.$refs.input fileInput.addEventListener('change', this.readFile) }, beforeUnmount: function () { + // remove the event listeners + const trigger = this.getTriggerDOM() + if (trigger) { + trigger.removeEventListener('click', this.pickImage) + } const fileInput = this.$refs.input fileInput.removeEventListener('change', this.readFile) } diff --git a/src/components/image_cropper/image_cropper.vue b/src/components/image_cropper/image_cropper.vue index 9d8ecd173..0122d1216 100644 --- a/src/components/image_cropper/image_cropper.vue +++ b/src/components/image_cropper/image_cropper.vue @@ -1,14 +1,13 @@ @@ -62,15 +89,13 @@