diff options
Diffstat (limited to 'js/components/layout')
31 files changed, 117 insertions, 90 deletions
diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css index 9d0a1eb4..9d0a1eb4 100644..100755 --- a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css | |||
diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html index b3fdb0b6..b3fdb0b6 100644..100755 --- a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html | |||
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 index 65e5b7c8..3f5b87e1 100644..100755 --- a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js | |||
@@ -7,45 +7,38 @@ | |||
7 | var Montage = require("montage/core/core").Montage; | 7 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 8 | var Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | |||
11 | exports.BreadcrumbButton = Montage.create(Component, { | 10 | exports.BreadcrumbButton = Montage.create(Component, { |
12 | 11 | ||
13 | button: { value: null }, | 12 | button: { |
13 | value: null | ||
14 | }, | ||
14 | 15 | ||
15 | data: { value: null }, | 16 | data: { |
17 | value: null | ||
18 | }, | ||
16 | 19 | ||
17 | prepareForDraw: { | 20 | prepareForDraw: { |
18 | enumerable: false, | ||
19 | value: function() { | 21 | value: function() { |
20 | this.element.addEventListener("mousedown", this, false); | 22 | this.element.addEventListener("mousedown", this, false); |
21 | } | 23 | } |
22 | }, | 24 | }, |
23 | 25 | ||
24 | draw: { | 26 | draw: { |
25 | enumerable: false, | ||
26 | value: function() { | 27 | value: function() { |
27 | 28 | if(this.data.element.id === "UserContent") { | |
28 | if(this.data.element.id==="UserContent"){ | 29 | this.button.innerHTML = "Body"; |
29 | 30 | } else { | |
30 | this.button.innerHTML = "Body"; | 31 | this.button.innerHTML = this.data.element.nodeName; |
31 | } | 32 | } |
32 | |||
33 | else{ | ||
34 | this.button.innerHTML=this.data.element.nodeName; | ||
35 | } | ||
36 | |||
37 | } | 33 | } |
38 | }, | 34 | }, |
39 | 35 | ||
40 | handleMousedown: { | 36 | handleMousedown: { |
41 | value: function(event) { | 37 | value: function(event) { |
42 | 38 | ||
43 | if(event.which===1){ | 39 | //this.data.selected=true; |
44 | 40 | NJevent('breadCrumbTrail',this.data); | |
45 | this.data.selected=true; | 41 | //this.data.selected=false; |
46 | NJevent('breadCrumbTrail',this.data); | ||
47 | this.data.selected=false; | ||
48 | } | ||
49 | 42 | ||
50 | } | 43 | } |
51 | } | 44 | } |
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.css b/js/components/layout/bread-crumb.reel/bread-crumb.css index cc984609..cc984609 100644..100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.css +++ b/js/components/layout/bread-crumb.reel/bread-crumb.css | |||
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index 67328479..c1b9ed61 100644..100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html | |||
@@ -62,7 +62,7 @@ | |||
62 | 62 | ||
63 | <div id="breadcrumb_trail" class="breadcrumbtrail"> | 63 | <div id="breadcrumb_trail" class="breadcrumbtrail"> |
64 | <div id="breadcrumb_container" class="bread_crumb"> | 64 | <div id="breadcrumb_container" class="bread_crumb"> |
65 | <div id="breadcrumb_button" class="toolbutton"></div> | 65 | <div id="breadcrumb_button"></div> |
66 | </div> | 66 | </div> |
67 | </div> | 67 | </div> |
68 | 68 | ||
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index 9782d9d1..1824c7c3 100644..100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js | |||
@@ -7,13 +7,12 @@ | |||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | exports.Breadcrumb = Montage.create(Component, { | 10 | var Breadcrumb = exports.Breadcrumb = Montage.create(Component, { |
11 | 11 | ||
12 | _container:{ | 12 | _container:{ |
13 | value:null | 13 | value:null |
14 | }, | 14 | }, |
15 | 15 | ||
16 | |||
17 | container: { | 16 | container: { |
18 | set: function(value) { | 17 | set: function(value) { |
19 | if(this._container !== value) { | 18 | if(this._container !== value) { |
@@ -30,10 +29,10 @@ exports.Breadcrumb = Montage.create(Component, { | |||
30 | value: [] | 29 | value: [] |
31 | }, | 30 | }, |
32 | 31 | ||
32 | |||
33 | deserializedFromTemplate : { | 33 | deserializedFromTemplate : { |
34 | value: function() { | 34 | value: function() { |
35 | this.eventManager.addEventListener( "appLoaded", this, false); | 35 | this.eventManager.addEventListener( "appLoaded", this, false); |
36 | this.eventManager.addEventListener( "openDocument", this, false); | ||
37 | this.eventManager.addEventListener( "breadCrumbTrail", this, false); | 36 | this.eventManager.addEventListener( "breadCrumbTrail", this, false); |
38 | } | 37 | } |
39 | }, | 38 | }, |
@@ -46,6 +45,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
46 | boundObjectPropertyPath: "currentSelectedContainer", | 45 | boundObjectPropertyPath: "currentSelectedContainer", |
47 | oneway: false | 46 | oneway: false |
48 | }); | 47 | }); |
48 | |||
49 | } | 49 | } |
50 | }, | 50 | }, |
51 | 51 | ||
@@ -53,47 +53,47 @@ exports.Breadcrumb = Montage.create(Component, { | |||
53 | value: function() { | 53 | value: function() { |
54 | var parentNode; | 54 | var parentNode; |
55 | 55 | ||
56 | while(this.containerElements.pop()){ | 56 | this.containerElements.length = 0 |
57 | // To empty the array to get the new parentNode of the new currentLevel | ||
58 | } | ||
59 | 57 | ||
60 | if(this.container.id === "UserContent") { | 58 | if(this.container.id === "UserContent") { |
61 | this.containerElements.push({selected:false,element:this.container}); | 59 | this.containerElements.push({selected:false, element:this.container}); |
62 | } else { | 60 | } else { |
63 | |||
64 | parentNode = this.container; | 61 | parentNode = this.container; |
65 | 62 | ||
66 | while(parentNode.id !== "UserContent") { |