|
|
@ -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);
|
|
|
|