aboutsummaryrefslogtreecommitdiff
path: root/js/components
diff options
context:
space:
mode:
authorEric Guzman2012-06-20 19:42:03 -0700
committerEric Guzman2012-06-20 19:42:03 -0700
commit3270aac4980c908f305fb53abadda5121ff6b9cb (patch)
tree6255aaab239fde71b1f4862dd70de7be62f48b85 /js/components
parenta5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff)
parent87377c81da06abf6d656017859830a3ab2902f0e (diff)
downloadninja-3270aac4980c908f305fb53abadda5121ff6b9cb.tar.gz
Merge branch 'binding' of github.com:dhg637/ninja-internal into binding
Diffstat (limited to 'js/components')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.html2
-rwxr-xr-xjs/components/layout/document-entry.reel/document-entry.html2
-rwxr-xr-xjs/components/menu/menu-entry.reel/menu-entry.js30
-rwxr-xr-xjs/components/menu/menu-item.reel/menu-item.js9
-rwxr-xr-xjs/components/menu/menu.reel/menu.html3
-rwxr-xr-xjs/components/menu/menu.reel/menu.js9
-rw-r--r--js/components/toolbar.reel/toolbar-button.js2
-rwxr-xr-xjs/components/tools-properties/fill-properties.reel/fill-properties.html4
-rwxr-xr-xjs/components/tools-properties/ink-bottle-properties.reel/ink-bottle-properties.html10
-rwxr-xr-xjs/components/ui/label-checkbox.reel/label-checkbox.html2
10 files changed, 25 insertions, 48 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html
index 68f3be2b..ee314628 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.html
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.html
@@ -21,7 +21,7 @@
21 }, 21 },
22 22
23 "breadCrumbButton": { 23 "breadCrumbButton": {
24 "prototype": "montage/ui/button.reel", 24 "prototype": "montage/ui/native/button.reel",
25 "properties": { 25 "properties": {
26 "element": {"#": "breadcrumb_button"} 26 "element": {"#": "breadcrumb_button"}
27 }, 27 },
diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html
index e68d17c5..ebaa4ccd 100755
--- a/js/components/layout/document-entry.reel/document-entry.html
+++ b/js/components/layout/document-entry.reel/document-entry.html
@@ -20,7 +20,7 @@
20 }, 20 },
21 21
22 "closeButton": { 22 "closeButton": {
23 "prototype": "montage/ui/button.reel", 23 "prototype": "montage/ui/native/button.reel",
24 "properties": { 24 "properties": {
25 "element": {"#": "close-btn"}, 25 "element": {"#": "close-btn"},
26 "identifier": "closeButton" 26 "identifier": "closeButton"
diff --git a/js/components/menu/menu-entry.reel/menu-entry.js b/js/components/menu/menu-entry.reel/menu-entry.js
index b9c546ed..0f5503f6 100755
--- a/js/components/menu/menu-entry.reel/menu-entry.js
+++ b/js/components/menu/menu-entry.reel/menu-entry.js
@@ -9,18 +9,15 @@ var Component = require("montage/ui/component").Component;
9 9
10exports.MenuEntry = Montage.create(Component, { 10exports.MenuEntry = Montage.create(Component, {
11 topHeader: { 11 topHeader: {
12 value: null, 12 value: null
13 serializable: true
14 }, 13 },
15 14
16 topHeaderText: { 15 topHeaderText: {
17 value: null, 16 value: null
18 serializable: true
19 }, 17 },
20 18
21 subEntries: { 19 subEntries: {
22 value: null, 20 value: null
23 serializable: true
24 }, 21 },
25 22
26 // Reference to the parent Menu component 23 // Reference to the parent Menu component
@@ -36,8 +33,7 @@ exports.MenuEntry = Montage.create(Component, {
36 if(value !== this._menu) { 33 if(value !== this._menu) {
37 this._menu = value; 34 this._menu = value;
38 } 35 }
39 }, 36 }
40 serializable: true
41 }, 37 },
42 38
43 _data: { 39 _data: {
@@ -52,8 +48,7 @@ exports.MenuEntry = Montage.create(Component, {
52 if(this._data !== value) { 48 if(this._data !== value) {
53 this._data = value; 49 this._data = value;
54 } 50 }
55 }, 51 }
56 serializable: true
57 }, 52 },
58 53
59 select: { 54 select: {
@@ -79,22 +74,20 @@ exports.MenuEntry = Montage.create(Component, {
79 return this._menuIsActive; 74 return this._menuIsActive;
80 }, 75 },
81 set: function(value) { 76 set: function(value) {
82 if(value) this.topHeader.addEventListener("mouseover", this, false); 77 if(value) this.element.addEventListener("mouseover", this, false);
83 } 78 }
84 }, 79 },
85 80
86 handleClick: { 81 captureMousedown: {
87 value: function(event) { 82 value: function(event) {
88 // TODO: Hack! Rework this! 83 // TODO: Hack! Rework this!
89 this.parentComponent.ownerComponent.toggleActivation(this); 84 this.parentComponent.ownerComponent.toggleActivation(this);
90// this._menu.toggleActivation(this);
91 } 85 }
92 }, 86 },
93 87
94 handleMouseover: { 88 handleMouseover: {
95 value: function(event) { 89 value: function(event) {
96 this.parentComponent.ownerComponent.activeEntry = this; 90 this.parentComponent.ownerComponent.activeEntry = this;
97// this._menu.activeEntry = this;
98 } 91 }
99 }, 92 },
100 93
@@ -105,14 +98,7 @@ exports.MenuEntry = Montage.create(Component, {
105 98
106 this.topHeaderText.innerHTML = this.data.header; 99 this.topHeaderText.innerHTML = this.data.header;
107 100
108 this.element.addEventListener("click", this, false); 101 this.element.addEventListener("mousedown", this, true);
109
110 Object.defineBinding(this, "menuIsActive", {
111 boundObject: this._menu,
112 boundObjectPropertyPath: "active",
113 oneway: true
114 });
115
116 } 102 }
117 } 103 }
118}); \ No newline at end of file 104}); \ No newline at end of file
diff --git a/js/components/menu/menu-item.reel/menu-item.js b/js/components/menu/menu-item.reel/menu-item.js
index f9a625a3..3a5bf4ab 100755
--- a/js/components/menu/menu-item.reel/menu-item.js
+++ b/js/components/menu/menu-item.reel/menu-item.js
@@ -10,18 +10,15 @@ var Component = require("montage/ui/component").Component;
10exports.MenuItem = Montage.create(Component, { 10exports.MenuItem = Montage.create(Component, {
11 11
12 itemBackground: { 12 itemBackground: {
13 value: null, 13 value: null
14 serializable: true
15 }, 14 },
16 15
17 itemText: { 16 itemText: {
18 value: null, 17 value: null
19 serializable: true
20 }, 18 },
21 19
22 subMenu: { 20 subMenu: {
23 value: null, 21 value: null
24 serializable: true
25 }, 22 },
26 23
27 data: { 24 data: {
diff --git a/js/components/menu/menu.reel/menu.html b/js/components/menu/menu.reel/menu.html
index f18c1a0f..98ffa92c 100755
--- a/js/components/menu/menu.reel/menu.html
+++ b/js/components/menu/menu.reel/menu.html
@@ -44,7 +44,8 @@
44 "element": { "#": "menuItem" } 44 "element": { "#": "menuItem" }
45 }, 45 },
46 "bindings": { 46 "bindings": {
47 "data": {"<-": "@repetition.objectAtCurrentIteration"} 47 "data": {"<-": "@repetition.objectAtCurrentIteration"},
48 "menuIsActive": {"<-": "@owner.active"}
48 } 49 }
49 }, 50 },
50 51
diff --git a/js/components/menu/menu.reel/menu.js b/js/components/menu/menu.reel/menu.js
index 50d3f0bc..1560100a 100755
--- a/js/components/menu/menu.reel/menu.js
+++ b/js/components/menu/menu.reel/menu.js
@@ -83,19 +83,12 @@ exports.Menu = Montage.create(Component, {
83 83
84 handleMousedown: { 84 handleMousedown: {
85 value: function(evt) { 85 value: function(evt) {
86
87 if(this.active && (this.getZIndex(evt.target) < 9000 || evt.target.id === "topMenu")) { 86 if(this.active && (this.getZIndex(evt.target) < 9000 || evt.target.id === "topMenu")) {
88 this._activeEntry.deselect(); 87 this._activeEntry.deselect();
89 this._activeEntry = null; 88 this._activeEntry = null;
90 this.active = false; 89 this.active = false;
91 90 this.element.ownerDocument.removeEventListener('mousedown', this, false);
92 //console.log(this.rep.objects[1]);
93 //this.controller.content[1].header = "BLAH";
94 } 91 }
95
96// console.log(evt.target.style['z-index']);
97// console.log(this.getZIndex(evt.target));
98
99 } 92 }
100 }, 93 },
101 94
diff --git a/js/components/toolbar.reel/toolbar-button.js b/js/components/toolbar.reel/toolbar-button.js
index 74129c2a..cfa86f76 100644
--- a/js/components/toolbar.reel/toolbar-button.js
+++ b/js/components/toolbar.reel/toolbar-button.js
@@ -6,7 +6,7 @@
6 6