From dad4e3aa51b9f2b370f20f13bdb00ccc33f8d891 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 25 May 2012 16:34:52 -0700 Subject: Object component - Minor cleanup --- js/panels/objects/object.reel/object.js | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'js/panels') diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js index 953c1baf..43abafad 100644 --- a/js/panels/objects/object.reel/object.js +++ b/js/panels/objects/object.reel/object.js @@ -57,41 +57,19 @@ exports.Object = Montage.create(Component, { get: function() { return this._montageLabel; }, - set: function(value) { - if(this._montageMetaData === value) { return false; } + set: function(data) { + if(this._montageMetaData === data) { return false; } - this._montageMetaData = value; + this._montageMetaData = data; - if(!this.identifier && value.label) { - this.label = value.label; + if(!this.identifier && data.label) { + this.label = data.label; this.needsDraw = true; } } }, - templateDidLoad: { - value: function() { - console.log('object loaded'); - } - }, - - prepareForDraw : { - value: function() { - - } - }, - - willDraw : { - value: function() { - if(this._needsPropertyInspection) { - - } - - console.log("This label ", this.label); - } - }, - draw : { value: function() { -- cgit v1.2.3 From 1be5495b77c1dd426be3a6be05555254856de6ba Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Fri, 25 May 2012 16:35:17 -0700 Subject: Object Component - Enable native dragging --- js/panels/objects/object.reel/object.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/objects/object.reel/object.html b/js/panels/objects/object.reel/object.html index efc66d79..a072ab5e 100644 --- a/js/panels/objects/object.reel/object.html +++ b/js/panels/objects/object.reel/object.html @@ -38,7 +38,7 @@ -
  • +
  • -- cgit v1.2.3 From 04ef4ffcfde762a0aead4a7b702f3c019fdbeb69 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 31 May 2012 21:57:22 -0700 Subject: Binding Panel - Developed panel components. --- js/panels/binding-panel.reel/binding-panel.css | 11 +++++++ js/panels/binding-panel.reel/binding-panel.html | 26 ++++++++++++++- js/panels/binding-panel.reel/binding-panel.js | 14 ++++++++ .../binding/binding-item.reel/binding-item.css | 13 ++++++++ .../binding/binding-item.reel/binding-item.html | 37 ++++++++++++++++++++++ .../binding/binding-item.reel/binding-item.js | 26 +++++++++++++++ 6 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 js/panels/binding/binding-item.reel/binding-item.css create mode 100644 js/panels/binding/binding-item.reel/binding-item.html create mode 100644 js/panels/binding/binding-item.reel/binding-item.js (limited to 'js/panels') diff --git a/js/panels/binding-panel.reel/binding-panel.css b/js/panels/binding-panel.reel/binding-panel.css index e69de29b..8597a926 100644 --- a/js/panels/binding-panel.reel/binding-panel.css +++ b/js/panels/binding-panel.reel/binding-panel.css @@ -0,0 +1,11 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
    + No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
    + (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
    */ + + +.bindings-list { + padding: 0; + margin: 0; +} \ No newline at end of file diff --git a/js/panels/binding-panel.reel/binding-panel.html b/js/panels/binding-panel.reel/binding-panel.html index 0db7b95f..d2e18e99 100644 --- a/js/panels/binding-panel.reel/binding-panel.html +++ b/js/panels/binding-panel.reel/binding-panel.html @@ -15,6 +15,28 @@ "properties": { "element": {"#": "binding"} } + }, + "arrayController": { + "prototype": "montage/ui/controller/array-controller", + "bindings": { + "content" : {"<-": "@owner.bindings" } + } + }, + "repetition": { + "prototype": "montage/ui/repetition.reel", + "properties": { + "element": {"#": "bindings-list"}, + "contentController": {"@": "arrayController"} + } + }, + "bindingItem": { + "prototype": "js/panels/binding/binding-item.reel", + "properties": { + "element": {"#": "binding-item"} + }, + "bindings": { + "sourceObjectPropertyPath": {"<-": "@repetition.objectAtCurrentIteration.sourceObjectPropertyPath"} + } } } @@ -22,7 +44,9 @@
    - this is a test +
    \ No newline at end of file diff --git a/js/panels/binding-panel.reel/binding-panel.js b/js/panels/binding-panel.reel/binding-panel.js index 03fe5723..9fdec416 100644 --- a/js/panels/binding-panel.reel/binding-panel.js +++ b/js/panels/binding-panel.reel/binding-panel.js @@ -4,6 +4,20 @@ var Montage = require("montage/core/core").Montage, exports.BindingPanel = Montage.create(Component, { + bindings : { + value: null + }, + + templateDidLoad : { + value: function() { + Object.defineBinding(this, 'bindings', { + boundObject: this.application.ninja.objectsController, + boundObjectPropertyPath: "currentObjectBindings", + oneway: true + }); + } + }, + prepareForDraw: { value: function() { console.log("test- objects"); diff --git a/js/panels/binding/binding-item.reel/binding-item.css b/js/panels/binding/binding-item.reel/binding-item.css new file mode 100644 index 00000000..dc90f162 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.css @@ -0,0 +1,13 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
    + No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
    + (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
    */ + +.binding-item { + color: #FFF; + margin: 0 8px; + padding: 3px; + border-bottom: 1px solid #FFF; + list-style-type: none; +} \ No newline at end of file diff --git a/js/panels/binding/binding-item.reel/binding-item.html b/js/panels/binding/binding-item.reel/binding-item.html new file mode 100644 index 00000000..23182345 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.html @@ -0,0 +1,37 @@ + + + + + + + + + +
  • + +
  • + + \ No newline at end of file diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js new file mode 100644 index 00000000..9365da65 --- /dev/null +++ b/js/panels/binding/binding-item.reel/binding-item.js @@ -0,0 +1,26 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
    + No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
    + (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
    */ + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + + +exports.BindingItem = Montage.create(Component, { + + sourceObjectPropertyPath : { value: null }, + + templateDidLoad : { + value: function() { + console.log("loaded binding item"); + } + }, + + prepareForDraw: { + value: function() { + console.log("preparing to draw binding item"); + } + } +}); \ No newline at end of file -- cgit v1.2.3