From 1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Fri, 2 Mar 2012 10:55:51 -0800
Subject: CSS Panel - Updating components, created toolbar components, and
small changes to styles controller
---
.../style-sheets-view.reel/style-sheets-view.css | 19 +++++++++++
.../style-sheets-view.reel/style-sheets-view.html | 38 ++++++++++++++++++----
.../style-sheets-view.reel/style-sheets-view.js | 27 ++++++++++++---
3 files changed, 74 insertions(+), 10 deletions(-)
(limited to 'js/panels/css-panel/style-sheets-view.reel')
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
index e69de29b..dfb67d13 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.css
@@ -0,0 +1,19 @@
+/*
+ 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.
+ */
+.style-sheets-view-container ul {
+ margin: 0;
+ padding: 0;
+}
+.style-sheets-view-container li {
+ list-style-type: none;
+ margin: 0 8px;
+}
+.style-sheets-view-container li:first-child {
+ margin-top: 5px;
+}
+.style-sheets-view-container li:last-child {
+ margin-bottom: 5px;
+}
\ No newline at end of file
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
index d1dbfa2b..092b189f 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -7,13 +7,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
+
-
-
No document loaded. Please Open or Create a new document.
+
+
No style sheets to display.
+
\ No newline at end of file
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
index f8826b18..b1315311 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
@@ -11,6 +11,9 @@ exports.StyleSheetsView = Montage.create(Component, {
noDocumentCondition : {
value: true
},
+ showToolbar : {
+ value: false
+ },
styleSheets : {
value: []
},
@@ -24,18 +27,27 @@ exports.StyleSheetsView = Montage.create(Component, {
this.stylesController = this.application.ninja.stylesController;
this.eventManager.addEventListener("styleSheetsReady", this, false);
+ this.eventManager.addEventListener("newStyleSheet", this, false);
}
},
+ _initView : {
+ value: false
+ },
handleStyleSheetsReady : {
value: function(e) {
- this.noDocumentCondition = false;
+ this._initView = this.needsDraw = true;
- this.stylesController.userStyleSheets.forEach(function(sheet) {
- this.styleSheets.push(sheet);
- }, this);
+// this.noDocumentCondition = false;
+// this.showToolbar = true;
+// this.styleSheets = this.stylesController.userStyleSheets;
}
},
+ handleNewStyleSheet : {
+ value: function(e) {
+ this.styleSheets.push(e._event.detail);
+ }
+ },
prepareForDraw : {
value: function() {
console.log("style sheet view - prepare for draw");
@@ -44,6 +56,13 @@ exports.StyleSheetsView = Montage.create(Component, {
draw : {
value: function() {
console.log("styles sheet view - draw");
+
+ if(this._initView) {
+ this.noDocumentCondition = false;
+ this.showToolbar = true;
+ this.styleSheets = this.stylesController.userStyleSheets;
+ this._initView = false;
+ }
}
}
});
\ No newline at end of file
--
cgit v1.2.3