Skip to content
Snippets Groups Projects
Commit 871ff3ae authored by Ron Lucke's avatar Ron Lucke Committed by Jan-Hendrik Willms
Browse files

fix #4340

Closes #4340

Merge request studip/studip!3142
parent b1f13ce8
No related branches found
No related tags found
No related merge requests found
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<studip-file-chooser <studip-file-chooser
v-model="currentFileId" v-model="currentFileId"
selectable="file" selectable="file"
:courseId="studipContext.id" :courseId="context.id"
:userId="userId" :userId="userId"
:isImage="true" :isImage="true"
:excludedCourseFolderTypes="excludedCourseFolderTypes" :excludedCourseFolderTypes="excludedCourseFolderTypes"
...@@ -187,7 +187,7 @@ export default { ...@@ -187,7 +187,7 @@ export default {
currentUserView: 'own', currentUserView: 'own',
currentFile: {}, currentFile: {},
context: {}, canvasContext: {},
paint: false, paint: false,
write: false, write: false,
clickX: [], clickX: [],
...@@ -221,7 +221,6 @@ export default { ...@@ -221,7 +221,6 @@ export default {
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
studipContext: 'context',
fileRefById: 'file-refs/byId', fileRefById: 'file-refs/byId',
getUserDataById: 'courseware-user-data-fields/byId', getUserDataById: 'courseware-user-data-fields/byId',
relatedUserData: 'user-data-field/related', relatedUserData: 'user-data-field/related',
...@@ -301,9 +300,7 @@ export default { ...@@ -301,9 +300,7 @@ export default {
return this.currentUploadFolderId !== ""; return this.currentUploadFolderId !== "";
}, },
canSwitchView() { canSwitchView() {
// this feature is not something to offer in the Arbeitsplatz! if (this.context.type !== 'courses') {
let context = this.$store.getters.context;
if (context.type !== 'courses') {
return false; return false;
} }
if (this.currentShowUserData === 'off') { if (this.currentShowUserData === 'off') {
...@@ -419,7 +416,7 @@ export default { ...@@ -419,7 +416,7 @@ export default {
} else { } else {
canvas.height = 500; canvas.height = 500;
} }
this.context = canvas.getContext('2d'); this.canvasContext = canvas.getContext('2d');
this.setColor('blue'); this.setColor('blue');
this.currentSize = this.sizes['normal']; this.currentSize = this.sizes['normal'];
this.currentTool = this.tools['pen']; this.currentTool = this.tools['pen'];
...@@ -427,7 +424,7 @@ export default { ...@@ -427,7 +424,7 @@ export default {
}, },
redraw() { redraw() {
let view = this; let view = this;
let context = view.context; let context = view.canvasContext;
context.clearRect(0, 0, context.canvas.width, context.canvas.height); // Clears the canvas context.clearRect(0, 0, context.canvas.width, context.canvas.height); // Clears the canvas
context.fillStyle = '#ffffff'; context.fillStyle = '#ffffff';
context.fillRect(0, 0, context.canvas.width, context.canvas.height); // set background context.fillRect(0, 0, context.canvas.width, context.canvas.height); // set background
...@@ -658,7 +655,7 @@ export default { ...@@ -658,7 +655,7 @@ export default {
}, },
async store() { async store() {
let user = this.usersById({id: this.userId}); let user = this.usersById({id: this.userId});
let imageBase64 = this.context.canvas.toDataURL("image/jpeg", 1.0); let imageBase64 = this.canvasContext.canvas.toDataURL("image/jpeg", 1.0);
let image = await fetch(imageBase64); let image = await fetch(imageBase64);
let imageBlob = await image.blob(); let imageBlob = await image.blob();
let file = {}; let file = {};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment