manually apply fabricjs update

pull/1/head
ansuz 3 years ago
parent 09fb604c3b
commit ba0a0bc9c2

@ -27,7 +27,6 @@
"marked": "1.1.0", "marked": "1.1.0",
"rangy": "rangy-release#~1.3.0", "rangy": "rangy-release#~1.3.0",
"json.sortify": "~2.1.0", "json.sortify": "~2.1.0",
"secure-fabric.js": "secure-v1.7.9",
"hyperjson": "~1.4.0", "hyperjson": "~1.4.0",
"chainpad-crypto": "^0.2.0", "chainpad-crypto": "^0.2.0",
"chainpad-listmap": "^1.0.0", "chainpad-listmap": "^1.0.0",

@ -9,3 +9,5 @@ This file is intended to be used as a log of what third-party source we have ven
* [jquery.ui 1.12.1](https://jqueryui.com/) for its 'autocomplete' extension which is used for our tag picker * [jquery.ui 1.12.1](https://jqueryui.com/) for its 'autocomplete' extension which is used for our tag picker
* [pdfjs](https://mozilla.github.io/pdf.js/) with some minor modifications to prevent CSP errors * [pdfjs](https://mozilla.github.io/pdf.js/) with some minor modifications to prevent CSP errors
* [mermaidjs 8.4.8](https://mermaid-js.github.io/mermaid/#/) extends our markdown integration to support a variety of diagram types * [mermaidjs 8.4.8](https://mermaid-js.github.io/mermaid/#/) extends our markdown integration to support a variety of diagram types
* [Fabricjs 4.6.0](https://github.com/fabricjs/fabric.js) and [Fabric-history](https://github.com/lyzerk/fabric-history) for the whiteboard app

File diff suppressed because one or more lines are too long

@ -14,7 +14,7 @@ define([
'/customize/application_config.js', '/customize/application_config.js',
'/bower_components/chainpad/chainpad.dist.js', '/bower_components/chainpad/chainpad.dist.js',
'/bower_components/secure-fabric.js/dist/fabric.min.js', '/lib/fabric.min.js',
'less!/whiteboard/app-whiteboard.less' 'less!/whiteboard/app-whiteboard.less'
], function ( ], function (
$, $,
@ -123,7 +123,7 @@ define([
APP.draw = true; APP.draw = true;
$brush.click(function () { $brush.click(function () {
if (APP.draw) { return; } if (APP.draw) { return; }
canvas.deactivateAll().renderAll(); canvas.discardActiveObject().renderAll();
APP.draw = true; APP.draw = true;
canvas.isDrawingMode = APP.draw; canvas.isDrawingMode = APP.draw;
$type.find('button').removeClass('btn-primary'); $type.find('button').removeClass('btn-primary');
@ -132,7 +132,7 @@ define([
}); });
$move.click(function () { $move.click(function () {
if (!APP.draw) { return; } if (!APP.draw) { return; }
canvas.deactivateAll().renderAll(); canvas.discardActiveObject().renderAll();
APP.draw = false; APP.draw = false;
canvas.isDrawingMode = APP.draw; canvas.isDrawingMode = APP.draw;
$type.find('button').removeClass('btn-primary'); $type.find('button').removeClass('btn-primary');
@ -171,14 +171,15 @@ define([
var deleteSelection = function () { var deleteSelection = function () {
if (APP.draw) { return; } if (APP.draw) { return; }
/*
if (canvas.getActiveObject()) { if (canvas.getActiveObject()) {
canvas.getActiveObject().remove(); canvas.getActiveObject().remove();
} }*/
if (canvas.getActiveGroup()) { if (canvas.getActiveObjects()) {
canvas.getActiveGroup()._objects.forEach(function (el) { canvas.getActiveObjects().forEach(function (el) {
el.remove(); APP.canvas.remove(el);
}); });
canvas.discardActiveGroup(); canvas.discardActiveObject();
} }
canvas.renderAll(); canvas.renderAll();
APP.onLocal(); APP.onLocal();
@ -342,7 +343,7 @@ define([
canvas.isDrawingMode = bool ? APP.draw : false; canvas.isDrawingMode = bool ? APP.draw : false;
if (!bool) { if (!bool) {
canvas.deactivateAll(); canvas.discardActiveObject();
canvas.renderAll(); canvas.renderAll();
} }
canvas.forEachObject(function (object) { canvas.forEachObject(function (object) {
@ -367,7 +368,7 @@ define([
APP.FM = framework._.sfCommon.createFileManager({}); APP.FM = framework._.sfCommon.createFileManager({});
APP.upload = function (title) { APP.upload = function (title) {
var canvas = $canvas[0]; var canvas = $canvas[0];
APP.canvas.deactivateAll().renderAll(); APP.canvas.discardActiveObject().renderAll();
canvas.toBlob(function (blob) { canvas.toBlob(function (blob) {
blob.name = title; blob.name = title;
APP.FM.handleFile(blob); APP.FM.handleFile(blob);

Loading…
Cancel
Save