diff options
Diffstat (limited to 'js/components/layout/bread-crumb-button.reel/bread-crumb-button.js')
-rw-r--r-- | js/components/layout/bread-crumb-button.reel/bread-crumb-button.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js new file mode 100644 index 00000000..65e5b7c8 --- /dev/null +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js | |||
@@ -0,0 +1,58 @@ | |||
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 | var Component = require("montage/ui/component").Component; | ||
9 | |||
10 | |||
11 | exports.BreadcrumbButton = Montage.create(Component, { | ||
12 | |||
13 | button: { value: null }, | ||
14 | |||
15 | data: { value: null }, | ||
16 | |||
17 | prepareForDraw: { | ||
18 | enumerable: false, | ||
19 | value: function() { | ||
20 | this.element.addEventListener("mousedown", this, false); | ||
21 | } | ||
22 | }, | ||
23 | |||
24 | draw: { | ||
25 | enumerable: false, | ||
26 | value: function() { | ||
27 | |||
28 | if(this.data.element.id==="UserContent"){ | ||
29 | |||
30 | this.button.innerHTML = "Body"; | ||
31 | } | ||
32 | |||
33 | else{ | ||
34 | this.button.innerHTML=this.data.element.nodeName; | ||
35 | } | ||
36 | |||
37 | } | ||
38 | }, | ||
39 | |||
40 | handleMousedown: { | ||
41 | value: function(event) { | ||
42 | |||
43 | if(event.which===1){ | ||
44 | |||
45 | this.data.selected=true; | ||
46 | NJevent('breadCrumbTrail',this.data); | ||
47 | this.data.selected=false; | ||
48 | } | ||
49 | |||
50 | } | ||
51 | } | ||
52 | |||
53 | |||
54 | |||
55 | |||
56 | |||
57 | |||
58 | }); \ No newline at end of file | ||