aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorArmen Kesablyan2012-06-15 15:19:56 -0700
committerArmen Kesablyan2012-06-15 15:19:56 -0700
commit9184efdaff88d3ce0e949dbe7ccbb3324dbfaae9 (patch)
tree8b2616eaaf354a6b444bdcd1422006abb708e5f5 /js/stage
parent022e2ba65070ee1e5eb2d4b197b88768a1ea3f4f (diff)
parentc7b5f04d41f54ccabfb385a02c47f131383797d8 (diff)
downloadninja-9184efdaff88d3ce0e949dbe7ccbb3324dbfaae9.tar.gz
Merge pull request #14 from ericguzman/binding
Binding
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.css11
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.html25
-rw-r--r--js/stage/objects-tray.reel/objects-tray.css33
-rw-r--r--js/stage/objects-tray.reel/objects-tray.html58
-rw-r--r--js/stage/objects-tray.reel/objects-tray.js53
5 files changed, 161 insertions, 19 deletions
diff --git a/js/stage/binding-view.reel/binding-view.css b/js/stage/binding-view.reel/binding-view.css
index 7f5de0b8..7ec31edf 100755
--- a/js/stage/binding-view.reel/binding-view.css
+++ b/js/stage/binding-view.reel/binding-view.css
@@ -5,6 +5,7 @@
5 </copyright> */ 5 </copyright> */
6 6
7.bindingView { 7.bindingView {
8 height: 100%;
8 position: absolute; 9 position: absolute;
9 width:100%; 10 width:100%;
10 z-index: 12; 11 z-index: 12;
@@ -22,4 +23,14 @@
22 height:100%; 23 height:100%;
23 position:absolute; 24 position:absolute;
24 z-index: 1; 25 z-index: 1;
26}
27
28.objects-tray-container {
29 bottom: 11px;
30 position: absolute;
31 width: 100%;
32 display: -webkit-box;
33 -webkit-box-orient: horizontal;
34 -webkit-box-pack: center;
35 -webkit-box-align: center;
25} \ No newline at end of file 36} \ No newline at end of file
diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html
index c7520132..5fb7affd 100755
--- a/js/stage/binding-view.reel/binding-view.html
+++ b/js/stage/binding-view.reel/binding-view.html
@@ -43,23 +43,10 @@
43 } 43 }
44 ] 44 ]
45 }, 45 },
46 "nonVisualRepeater": { 46 "objectsTray" : {
47 "prototype": "montage/ui/repetition.reel", 47 "prototype": "js/stage/objects-tray.reel",
48 "properties": {
49 "element": {"#": "nonVisualRepeater"}
50 },
51 "bindings": {
52 "objects": {"<-": "@owner.nonVisualComponents"}
53 }
54 },
55 "objectIcon": {
56 "prototype": "js/panels/objects/object.reel",
57 "properties": { 48 "properties": {
58 "element": {"#": "nonVisualComponent"} 49 "element": {"#": "objects-tray" }
59 },
60 "bindings": {
61 "sourceObject": {"<-": "@nonVisualRepeater.objectAtCurrentIteration"},
62 "identifier": {"<-": "@nonVisualRepeater.objectAtCurrentIteration.identifier"}
63 } 50 }
64 } 51 }
65 } 52 }
@@ -75,11 +62,11 @@
75 62
76 </div> 63 </div>
77 </div> 64 </div>
78 <div data-montage-id="nonVisualRepeater">
79 <div data-montage-id="nonVisualComponent">
80 65
81 </div> 66 <div class="objects-tray-container">
67 <div data-montage-id="objects-tray" ></div>
82 </div> 68 </div>
69
83 <canvas data-montage-id="bindingViewCanvas" class="bindingViewCanvas"></canvas> 70 <canvas data-montage-id="bindingViewCanvas" class="bindingViewCanvas"></canvas>
84 </section> 71 </section>
85 72
diff --git a/js/stage/objects-tray.reel/objects-tray.css b/js/stage/objects-tray.reel/objects-tray.css
new file mode 100644
index 00000000..422d6a8f
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.css
@@ -0,0 +1,33 @@
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/*
8
9<section data-montage-id="objects-panel" class="objects-panel">
10 <ul data-montage-id="list" class="objects-list">
11 <li data-montage-id="list-item" class="list-item"></li>
12 </ul>
13</section>
14
15*/
16
17.objects-list {
18 font-size: 11px;
19 margin: 10px 0 0 0;
20 padding: 0;
21 text-shadow: -1px -1px 0 #4D4D4D;
22}
23
24.objects-tray {
25 background-color: rgba(0,0,0,.6);
26 border-top-right-radius: 8px;
27 border-top-left-radius: 8px;
28 box-shadow: inset 0 0 3px #333;
29 padding: 0 10px 5px;
30 margin: 0 auto;
31 overflow: hidden;
32 -webkit-box-flex: 0;
33} \ No newline at end of file
diff --git a/js/stage/objects-tray.reel/objects-tray.html b/js/stage/objects-tray.reel/objects-tray.html
new file mode 100644
index 00000000..0fece3fe
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.html
@@ -0,0 +1,58 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html>
8<head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="objects-tray.css">
11
12 <script type="text/montage-serialization">
13 {
14 "owner": {
15 "prototype": "js/stage/objects-tray.reel",
16 "properties": {
17 "element": {"#": "objects-tray"}
18 }
19 },
20 "repetition" : {
21 "prototype": "montage/ui/repetition.reel",
22 "properties": {
23 "element": {"#": "list"},
24 "contentController": {"@": "arrayController"}
25 }
26 },
27 "arrayController": {
28 "prototype": "montage/ui/controller/array-controller",
29 "bindings": {
30 "content": {"<-": "@owner.objects"}
31 }
32 },
33 "objectComponent": {
34 "prototype": "js/panels/objects/object.reel",
35 "properties": {
36 "element": {"#": "list-item"}
37 },
38 "bindings": {
39 "sourceObject" : {"<-": "@repetition.objectAtCurrentIteration"},
40 "identifier" : {"<-": "@repetition.objectAtCurrentIteration.identifier"}
41 }
42 }
43
44 }
45 </script>
46
47</head>
48<body>
49
50
51<section data-montage-id="objects-tray" class="objects-tray">
52 <ul data-montage-id="list" class="objects-list">
53 <li data-montage-id="list-item" class="list-item"></li>
54 </ul>
55</section>
56
57</body>
58</html>
diff --git a/js/stage/objects-tray.reel/objects-tray.js b/js/stage/objects-tray.reel/objects-tray.js
new file mode 100644
index 00000000..ee1ecd06
--- /dev/null
+++ b/js/stage/objects-tray.reel/objects-tray.js
@@ -0,0 +1,53 @@
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/**
8 @requires montage/core/core
9 @requires montage/ui/component
10 */
11var Montage = require("montage/core/core").Montage,
12 Component = require("montage/ui/component").Component;
13
14exports.ObjectsTray = Montage.create(Component, {
15 _objects: { value: null },
16 objects: {
17 get: function() {
18 return this._objects;
19 },
20 set: function(value) {
21 this._objects = value;
22 this.needsDraw = true;
23 }
24 },
25
26
27 templateDidLoad: {
28 value: function() {
29 console.log('objects panel loaded');
30 }
31 },
32
33 prepareForDraw : {
34 value: function() {
35
36 Object.defineBinding(this, 'objects', {
37 "boundObject": this.application.ninja.objectsController,
38 "boundObjectPropertyPath": "objects",
39 "oneway": true
40 });
41
42 }
43 },
44 draw : {
45 value: function() {
46 console.log("objects panel draw");
47 if(this.objects) {