diff --git a/changelog.d/user_profile_edit.change b/changelog.d/user_profile_edit.change
new file mode 100644
index 000000000..dd2260260
--- /dev/null
+++ b/changelog.d/user_profile_edit.change
@@ -0,0 +1 @@
+Profile editing change overhaul
diff --git a/src/App.scss b/src/App.scss
index 64c8b8b82..51f2c9af3 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -782,12 +782,6 @@ 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 be281c5ae..cc00a735d 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 f3b6dfe9b..f6ba6e245 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -205,12 +205,6 @@ const EmojiInput = {
return emoji.displayText
}
},
- onInputScroll () {
- this.$refs.hiddenOverlay.scrollTo({
- top: this.input.scrollTop,
- left: this.input.scrollLeft
- })
- },
suggestionListId () {
return `suggestions-${this.randomSeed}`
},
@@ -239,7 +233,6 @@ 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)
@@ -302,6 +295,13 @@ 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,8 +561,6 @@ 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 f9788d874..057e6aa5c 100644
--- a/src/components/emoji_input/emoji_input.vue
+++ b/src/components/emoji_input/emoji_input.vue
@@ -115,6 +115,7 @@
display: flex;
flex-direction: column;
position: relative;
+ display: flex;
.emoji-picker-icon {
position: absolute;
@@ -123,7 +124,7 @@
margin: 0.2em 0.25em;
font-size: 1.3em;
cursor: pointer;
- line-height: 24px;
+ line-height: 1.2em;
&:hover i {
color: var(--text);
@@ -133,7 +134,7 @@
.emoji-picker-panel {
position: absolute;
z-index: 20;
- margin-top: 2px;
+ margin-top: 0.2em;
&.hide {
display: none;
@@ -152,7 +153,7 @@
}
&.with-picker input {
- padding-right: 30px;
+ padding-right: 2em;
}
.hidden-overlay {
@@ -215,8 +216,8 @@
}
.detailText {
- font-size: 9px;
- line-height: 9px;
+ font-size: 0.6em;
+ line-height: 0.6em;
}
}
}
diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js
index 3cb4f6fd1..32b615265 100644
--- a/src/components/image_cropper/image_cropper.js
+++ b/src/components/image_cropper/image_cropper.js
@@ -10,14 +10,6 @@ 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'
@@ -30,6 +22,9 @@ const ImageCropper = {
},
cancelButtonLabel: {
type: String
+ },
+ aspectRatio: {
+ type: Number
}
},
data () {
@@ -39,17 +34,7 @@ const ImageCropper = {
submitting: false
}
},
- 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')
- }
- },
+ emits: ['submit'],
methods: {
destroy () {
this.$refs.input.value = ''
@@ -65,20 +50,15 @@ const ImageCropper = {
} else {
cropperPromise = Promise.resolve()
}
+
cropperPromise.then(canvas => {
- this.submitHandler(canvas, this.file)
- .then(() => this.destroy())
- .finally(() => {
- this.submitting = false
- })
+ this.$emit('submit', { canvas, file: this.file })
+ 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) {
@@ -117,23 +97,11 @@ 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 0122d1216..9d8ecd173 100644
--- a/src/components/image_cropper/image_cropper.vue
+++ b/src/components/image_cropper/image_cropper.vue
@@ -1,13 +1,14 @@