From 3a2b178e93767b6e4f463fbc0a44e4b0d00ceec9 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 13 Jun 2012 19:07:54 -0700 Subject: Objects Panel - Fix CSS to simplify showing object icons in other panels --- js/panels/objects/object.reel/object.css | 2 +- js/panels/objects/object.reel/object.html | 5 +++-- js/panels/objects/object.reel/object.js | 29 +++++------------------------ 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/js/panels/objects/object.reel/object.css b/js/panels/objects/object.reel/object.css index 2612c392..64b2dbcc 100644 --- a/js/panels/objects/object.reel/object.css +++ b/js/panels/objects/object.reel/object.css @@ -54,7 +54,7 @@ box-shadow: 0 0 1px 1px #474747; } -.object-icon-component .object-icon { +.object-icon-component.object-icon { /* gray gear */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAACE5JREFUWIWdV2tsHNUV%2Fu6989iHd9frtVeJsUNsEW8AOYSkTUgs9SVKoahSUdpKSC0toBapSEhBVuFPsOxfFInSP6hCgoigVhS1IFVtgKBKaaIoxBFOChF1bceubRI7btbe3cyOZ%2BbOffRHPKP1I63cK11p5%2BzMOd853znnnkuwyTUwMIBSqdTKGOswTTOjtUYYho7jOFcmJibKL7300qb0GZsFQClNbN%2B%2B%2FWhXV9f9ACwA0FrzycnJv83NzR0C4G1K32YBSCltAD25XC6Zy%2BVYLpdjzc3NScZYDyHEbny3v7%2F%2Ff%2BrbMAJDQ0NwXbdg2%2FY%2Bx3E%2BfOWVV3Sk0DAMyzTNNKWrsRuGkWaMWdHz4cOHIaXE4ODgg57njbz44ovXN7JF1gqef%2F55FIvFXXv37n1z586du0%2BePPnG2NjYL0zTNLdu3frtbdu2%2FejOO%2B%2F8ajabZY3fOY4jR0dHT09PT%2F92YWHhuFIq2L179y%2F379%2F%2F04WFhc8uXrz44%2FHx8U%2BHhoZuDWBoaAjpdHrXgQMH3unp6dlJKYXv%2B3J0dHQ4k8n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s%2FPf3bq1KlV9jYebwAMDg625vP5fTMzMx%2B8%2FPLL8SExMDDQ2tfXd7G9vb2j8f25ublrw8PDu44cORJfQJ5%2B%2BmlSKpUerNVqnzTKG9ct74YDAwNlAO%2BvlQdBEEopl9fmhZTSC4JANMpeffVVDeCDW9kA%2Fo%2B74eLiIvc8bzYMw0ApJbXWMgzDwPO8maWlJb5ZfZu%2BHS8tLXkXLlz44RdffHFbcmUu9zzPu379%2BtVyuexuVt9%2FAKVP%2BiORVHX0AAAAAElFTkSuQmCC); } \ No newline at end of file diff --git a/js/panels/objects/object.reel/object.html b/js/panels/objects/object.reel/object.html index a072ab5e..6274f480 100644 --- a/js/panels/objects/object.reel/object.html +++ b/js/panels/objects/object.reel/object.html @@ -14,7 +14,8 @@ "owner": { "prototype": "js/panels/objects/object.reel", "properties": { - "element": {"#": "object"} + "element": {"#": "object"}, + "iconElement": { "#": "object-icon"} } }, "labelText": { @@ -39,7 +40,7 @@
  • -
    +
  • diff --git a/js/panels/objects/object.reel/object.js b/js/panels/objects/object.reel/object.js index 1e33b7f7..76f1b5bf 100644 --- a/js/panels/objects/object.reel/object.js +++ b/js/panels/objects/object.reel/object.js @@ -13,16 +13,8 @@ var Montage = require("montage/core/core").Montage, exports.Object = Montage.create(Component, { _needsPropertyInspection : { value: null }, - type: { value: null }, - getType : { - value: function() { - if(this._hasPrototype(this.sourceObject, 'Component')) { - return 'Component'; - } - - return null; - } - }, + iconElement : { value: null }, + type : { value: null }, _sourceObject : { value: null }, sourceObject : { @@ -36,7 +28,7 @@ exports.Object = Montage.create(Component, { if(object._montage_metadata) { this.montageMetaData = object._montage_metadata; - this.type = this.getType(); + this.type = this.application.ninja.objectsController.getObjectCategory(object); } this._needsPropertyInspection = this.needsDraw = true; @@ -83,23 +75,12 @@ exports.Object = Montage.create(Component, { }, - _hasPrototype : { - value: function(object, prototypeName) { - var prototypes = this.application.ninja.objectsController.getPrototypes(object).map(function(proto) { - var metadata = proto._montage_metadata; - return (metadata) ? metadata.objectName : "Object"; - }); - - return prototypes.indexOf(prototypeName) !== -1; - } - }, - draw : { value: function() { if(this.type) { - this.element.classList.add('object-icon-'+this.type.toLowerCase()); + this.iconElement.classList.add('object-icon-'+this.type.toLowerCase()); } else{ - this.element.classList.add('object-icon-default'); + this.iconElement.classList.add('object-icon-default'); } -- cgit v1.2.3