diff options
Diffstat (limited to 'js/tools/bindingTool.js')
-rw-r--r-- | js/tools/bindingTool.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js new file mode 100644 index 00000000..282e3408 --- /dev/null +++ b/js/tools/bindingTool.js | |||
@@ -0,0 +1,51 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | DrawingTool = require("js/tools/drawing-tool").DrawingTool, | ||
9 | ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase; | ||
10 | |||
11 | |||
12 | exports.BindingTool = Montage.create(ModifierToolBase, { | ||
13 | drawingFeedback: { value: { mode: "Draw2D", type: "" } }, | ||
14 | |||
15 | Configure: { | ||
16 | value: function (doActivate) | ||
17 | { | ||
18 | if (doActivate) | ||
19 | { | ||
20 | NJevent("enableStageMove"); | ||
21 | document.body.classList.add("ws-binding"); | ||
22 | |||
23 | } | ||
24 | else | ||
25 | { | ||
26 | NJevent("disableStageMove"); | ||
27 | document.body.classList.remove("ws-binding"); | ||
28 | } | ||
29 | } | ||
30 | }, | ||
31 | |||
32 | HandleLeftButtonDown: { | ||
33 | value: function(event) { | ||
34 | NJevent("enableStageMove"); | ||
35 | |||
36 | } | ||
37 | }, | ||
38 | |||
39 | HandleMouseMove: { | ||
40 | value: function(event) { | ||
41 | this.doDraw(event); | ||
42 | } | ||
43 | }, | ||
44 | |||
45 | HandleLeftButtonUp: { | ||
46 | value: function(event) { | ||
47 | this.endDraw(event); | ||
48 | NJevent("disableStageMove"); | ||
49 | } | ||
50 | } | ||
51 | }); \ No newline at end of file | ||