![]()
= max ? max : num;
+ },
+ calculateAspectRatioFit(srcWidth, srcHeight, maxWidth, maxHeight) {
+ let ratio = Math.min(maxWidth / srcWidth, maxHeight / srcHeight);
+ return { width: srcWidth*ratio, height: srcHeight*ratio };
+ },
+ imageSize() {
+ const messageLog = document.querySelector('.scroll');
+ const w = messageLog.offsetWidth;
+ const h = messageLog.offsetHeight;
+
+ const minWidth = w / 2;
+ const minHeight = h / 2;
+
+ const files = this.$props.files;
+ if (!files || files.length === 0 || !files[0].dimensions)
+ return undefined;
+ const dimensions = this.$props.files[0].dimensions
+ const srcWidth = dimensions.width;
+ const srcHeight = dimensions.height;
+
+ const newDimentions = this.calculateAspectRatioFit(srcWidth, srcHeight, minWidth, minHeight);
+
+ const imageTag = this.$refs['image'];
+
+ imageTag.style.width = this.clamp(newDimentions.width, 0, srcWidth) + "px"
+ imageTag.style.height = this.clamp(newDimentions.height, 0, srcHeight) + "px"
+ },
+ onResize(dimentions) {
+ this.imageSize();
}
},
+ watch: {
+ getWindowWidth(dimentions) {
+ this.onResize(dimentions)
+ }
+ },
+ mounted() {
+ const files = this.files;
+ if (!files || files.length === 0 || !files[0].dimensions)
+ return undefined;
+ this.imageSize();
+ },
computed: {
...mapState("settingsModule", ["apperance"]),
getImage() {
@@ -194,7 +236,10 @@ export default {
},
user() {
return this.$store.getters.user;
- }
+ },
+ getWindowWidth() {
+ return {width: windowProperties.resizeWidth, height: windowProperties.resizeHeight};
+ },
}
};
@@ -203,7 +248,7 @@ export default {
diff --git a/src/components/app/Tabs/Servers.vue b/src/components/app/Tabs/Servers.vue
index f5f32ec..51f9f37 100644
--- a/src/components/app/Tabs/Servers.vue
+++ b/src/components/app/Tabs/Servers.vue
@@ -96,6 +96,7 @@ export default {
right: 0;
bottom: 0;
height: calc(100% - 40px);
+ z-index: 1;
}
}
@@ -105,6 +106,7 @@ export default {
background-color: rgba(39, 39, 39, 0.97);
bottom: 0;
height: calc(100% - 40px);
+ z-index: 2;
}
}
diff --git a/src/components/app/relationships/FriendsTemplate.vue b/src/components/app/relationships/FriendsTemplate.vue
index 4f96ee7..a339f2f 100644
--- a/src/components/app/relationships/FriendsTemplate.vue
+++ b/src/components/app/relationships/FriendsTemplate.vue
@@ -1,7 +1,7 @@
.status-popout{
- position: absolute;
- background-color: rgba(44, 44, 44, 0.671);
- border-radius: 10px;
- padding: 5px;
- width: 180px;
- z-index: 1;
+ position: absolute;
+ background-color: rgba(26, 26, 26, 0.863);
+ border-radius: 10px;
+ padding: 5px;
+ width: 180px;
+ z-index: 1;
}
.status-list {
- padding: 5px;
- transition: 0.3s;
- border-radius: 5px;
- margin: 5px;
+ padding: 5px;
+ transition: 0.3s;
+ border-radius: 5px;
+ margin: 5px;
+ display: flex;
+ align-items: center;
+ align-content: center;
+ flex-shrink: 0;
+
}
.status-list:hover {
- background: rgba(0, 0, 0, 0.349);
+ background: rgba(0, 0, 0, 0.349);
}
.status-icon{
- display: inline-block;
+ display: inline-block;
+ flex-shrink: 0;
}
.icon{
- height: 30px;
- width: 30px;
- margin-top: 3px;
+ height: 20px;
+ width: 20px;
+ margin-top: 3px;
+ flex-shrink: 0;
}
.text{
- display: inline-block;
- vertical-align: top;
- margin-top: 9px;
- margin-left: 10px;
- padding-right: 5px;
+ display: inline-block;
+ vertical-align: top;
+ flex-shrink: 0;
+ margin-left: 10px;
+ padding-right: 5px;
}
diff --git a/src/utils/changelog.js b/src/utils/changelog.js
index 2811ac5..4860527 100644
--- a/src/utils/changelog.js
+++ b/src/utils/changelog.js
@@ -14,6 +14,17 @@
const config = [
+ {
+ version: 5.9,
+ title: "More Bug fixes!",
+ shortTitle: "",
+ date: "07/08/2019",
+ headColor: "rgba(255, 80, 17, 0.77)",
+ fix: [
+ "Fixed a bug where messages would appear blurry sometimes.",
+ "Fixed a bug where scrolling would be inverted in some devices.",
+ ]
+ },
{
version: 5.8,
title: "Bug fixes, Change password.",
diff --git a/src/utils/windowProperties.js b/src/utils/windowProperties.js
new file mode 100644
index 0000000..c14d473
--- /dev/null
+++ b/src/utils/windowProperties.js
@@ -0,0 +1,29 @@
+
+ import Vue from "vue";
+ import debounce from "lodash/debounce";
+
+ const WindowProperties = new Vue({
+ data () {
+ return {
+ resizeWidth: 0,
+ resizeHeight: 0,
+ }
+ },
+ created() {
+ this.resizeWidth = window.innerWidth;
+ this.resizeHeight = window.innerHeight;
+
+ this.debouncedResize = debounce(this.onResize, 20);
+ window.addEventListener("resize", this.debouncedResize);
+
+
+ },
+ methods: {
+ onResize() {
+ this.resizeWidth = window.innerWidth;
+ this.resizeHeight = window.innerHeight;
+ }
+ }
+ })
+
+ export default WindowProperties;
\ No newline at end of file
diff --git a/src/views/App.vue b/src/views/App.vue
index 0390359..10e371f 100644
--- a/src/views/App.vue
+++ b/src/views/App.vue
@@ -53,7 +53,7 @@