manually apply fabricjs update

This commit is contained in:
ansuz 2021-11-16 17:17:16 +05:30
parent 09fb604c3b
commit ba0a0bc9c2
4 changed files with 14 additions and 11 deletions

View file

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

View file

@ -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
* [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
* [Fabricjs 4.6.0](https://github.com/fabricjs/fabric.js) and [Fabric-history](https://github.com/lyzerk/fabric-history) for the whiteboard app

1
www/lib/fabric.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

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