feat(palette): integrate multi selection + space tool

related to #244
This commit is contained in:
Nico Rehwaldt 2015-04-30 17:54:51 +02:00
parent 4f236382a0
commit f0f475dad5
8 changed files with 43 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
@font-face {
font-family: 'bpmn';
src: url('../font/bpmn.eot?84549978');
src: url('../font/bpmn.eot?84549978#iefix') format('embedded-opentype'),
url('../font/bpmn.woff?84549978') format('woff'),
url('../font/bpmn.ttf?84549978') format('truetype'),
url('../font/bpmn.svg?84549978#bpmn') format('svg');
src: url('../font/bpmn.eot?3763319');
src: url('../font/bpmn.eot?3763319#iefix') format('embedded-opentype'),
url('../font/bpmn.woff?3763319') format('woff'),
url('../font/bpmn.ttf?3763319') format('truetype'),
url('../font/bpmn.svg?3763319#bpmn') format('svg');
font-weight: normal;
font-style: normal;
}
@ -14,7 +14,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'bpmn';
src: url('../font/bpmn.svg?84549978#bpmn') format('svg');
src: url('../font/bpmn.svg?3763319#bpmn') format('svg');
}
}
*/
@ -147,7 +147,6 @@
.icon-intermediate-event-throw-signal:before { content: '\e85a'; } /* '' */
.icon-intermediate-event-catch-non-interrupting-condition:before { content: '\e85b'; } /* '' */
.icon-participant:before { content: '\e85c'; } /* '' */
.icon-edit-default:before { content: '\e85d'; } /* '' */
.icon-edit-navigation:before { content: '\e85e'; } /* '' */
.icon-edit-space-tool:before { content: '\e85f'; } /* '' */
.icon-connection-multi:before { content: '\e860'; } /* '' */
.icon-space-tool:before { content: '\e85f'; } /* '' */
.icon-connection-multi:before { content: '\e860'; } /* '' */
.icon-multi-select-tool:before { content: '\e862'; } /* '' */

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Binary file not shown.

View File

@ -5,18 +5,19 @@ var assign = require('lodash/object/assign');
/**
* A palette provider for BPMN 2.0 elements.
*/
function PaletteProvider(palette, create, elementFactory, spaceTool) {
function PaletteProvider(palette, create, elementFactory, spaceTool, lassoTool) {
this._create = create;
this._elementFactory = elementFactory;
this._spaceTool = spaceTool;
this._lassoTool = lassoTool;
palette.registerProvider(this);
}
module.exports = PaletteProvider;
PaletteProvider.$inject = [ 'palette', 'create', 'elementFactory', 'spaceTool' ];
PaletteProvider.$inject = [ 'palette', 'create', 'elementFactory', 'spaceTool', 'lassoTool' ];
PaletteProvider.prototype.getPaletteEntries = function(element) {
@ -24,7 +25,8 @@ PaletteProvider.prototype.getPaletteEntries = function(element) {
var actions = {},
create = this._create,
elementFactory = this._elementFactory,
spaceTool = this._spaceTool;
spaceTool = this._spaceTool,
lassoTool = this._lassoTool;
function createAction(type, group, className, title, options) {
@ -55,16 +57,30 @@ PaletteProvider.prototype.getPaletteEntries = function(element) {
}
assign(actions, {
'multi-select-tool': {
group: 'tools',
className: 'icon-multi-select-tool',
title: 'Active the multi select tool',
action: {
click: function(event) {
lassoTool.activateSelection(event);
}
}
},
'space-tool': {
group: 'tool',
className: 'icon-edit-space-tool',
title: 'Create/remove space on the diagram',
group: 'tools',
className: 'icon-space-tool',
title: 'Activate the create/remove space tool',
action: {
click: function(event) {
spaceTool.activateSelection(event);
}
}
},
'tool-separator': {
group: 'tools',
separator: true
},
'create.start-event': createAction(
'bpmn:StartEvent', 'event', 'icon-start-event-none'
),

View File

@ -32,7 +32,7 @@ describe('palette', function() {
var paletteElement = domQuery('.djs-palette', container);
// then
expect(domQuery.all('.entry', paletteElement).length).toBe(9);
expect(domQuery.all('.entry', paletteElement).length).toBe(10);
done(err);
});