diff options
Diffstat (limited to 'js/mediators/mouse-mediator.js')
-rw-r--r-- | js/mediators/mouse-mediator.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/js/mediators/mouse-mediator.js b/js/mediators/mouse-mediator.js new file mode 100644 index 00000000..cef6c6c4 --- /dev/null +++ b/js/mediators/mouse-mediator.js | |||
@@ -0,0 +1,31 @@ | |||
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 | NJComponent = require("js/lib/nj-base").NJComponent; | ||
9 | |||
10 | exports.MouseMediator = Montage.create( NJComponent, { | ||
11 | hasTemplate: { | ||
12 | value: false | ||
13 | }, | ||
14 | |||
15 | deserializedFromTemplate: { | ||
16 | value: function() { | ||
17 | document.addEventListener("mouseup", this, false); | ||
18 | } | ||
19 | }, | ||
20 | |||
21 | handleMouseup: { | ||
22 | value: function(event) { | ||
23 | |||
24 | if(event._event.target.id !== "drawingCanvas") { | ||
25 | NJevent( "appMouseUp"); | ||
26 | } | ||
27 | |||
28 | return true; | ||
29 | } | ||
30 | } | ||
31 | }); | ||