From 72061f2cf3858f48a90f8cb21c5e7d766cb9552b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 5 Apr 2012 17:26:03 -0700 Subject: Style Sheets - Style update for edit view --- .../css-panel/style-sheet.reel/style-sheet.css | 52 ++++++++++++++++------ .../css-panel/style-sheet.reel/style-sheet.html | 8 ++-- .../css-panel/style-sheet.reel/style-sheet.js | 26 ++++++----- 3 files changed, 59 insertions(+), 27 deletions(-) diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.css b/js/panels/css-panel/style-sheet.reel/style-sheet.css index 37c94ef6..76bdbfe9 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.css +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.css @@ -35,20 +35,27 @@ .style-sheet-container input[type="text"] { min-width: 30px; -webkit-box-flex: 1; + margin-right: 25px; } -.style-sheet-container button { - -webkit-box-flex: 0; + +/* style sheet edit view */ + +.style-sheet-container .ss-edit-button { /* TODO: Use sass to minimize image redundancies */ - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1%2BjfqAAAACXBIWXMAAAsTAAALEwEAmpwYAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8%2FL5UBFTAyMHy7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N%2BQWVRZnpGiYKhpaWlgmNKflKqQnBlcUlqbrGCZ15yflFBflFiSWoKAwMD1A4GBgYGXpf8EgX3xMw8BSMDVQYqg4jIKAUICxE%2BCDEESC4tKoMHJQODAIMCgwGDA0MAQyJDPcMChqMMbxjFGV0YSxlXMN5jEmMKYprAdIFZmDmSeSHzGxZLlg6WW6x6rK2s99gs2aax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%2FV6vWLBYPDD8Xi8oJ%2FkarVaKhVatLlHxhgny7KfPCGdTt%2FS945W%2FEPUNO2KNihGIpH44XBI0Tak8Xh8hoJ4PC7RGCZN0BkOh3fEHUV6Gdi50%2BnUqaWxXC6FfD7%2FDQXNZvMtXdZyOBw6IUtw%2FwQYACT6GJDDh744AAAAAElFTkSuQmCC); background-repeat: no-repeat; - background-position: 0 1px; - border: none; + background-position: center center; cursor: pointer; padding: 0; - width: 21px; - height: 21px; - margin-left: 2px; - -webkit-transform: scale(.75); + width: 24px; + height: 100%; + opacity: 1; + position: relative; + left: -24px; + -webkit-transition: background-color .55s cubic-bezier(.44,.19,0,.99); + border-width: 0 0 0 1px; + border-style: none none none solid; + border-color: rgba(80, 80, 80, 0); opacity: .7; } .style-sheet-container button:hover { @@ -59,18 +66,35 @@ box-shadow: none; } -/* style sheet edit view */ .style-sheet-edit { - border-left: 1px solid #505050; position: absolute; top: 0; right: 0; margin-right: -100%; - background-color: #363636; height: 100%; width: 100%; - -webkit-transition: -webkit-transform .6s cubic-bezier(.44,.19,0,.99); + -webkit-transition-property: -webkit-transform, background-color; + -webkit-transition-duration: .55s; + -webkit-transition-timing-function: cubic-bezier(.44,.19,0,.99); +} +.style-sheet-edit.expanded .ss-edit-button { + background-color: #363636; + border-color: rgba(80, 80, 80, 1); + opacity: 1; } .style-sheet-edit.expanded { - -webkit-transform: translate3d(-250px, 0, 0); + background-color: #363636; +} +.style-sheet-edit button.nj-skinned { + height: 20px; + padding: 2px 10px; + margin-left: 5px; + position: relative; + left: -15px; + top: 2px; + text-transform: capitalize; + font-size: 10px; +} +.style-sheet-edit .ss-delete-button { + background: -webkit-linear-gradient(top, rgba(73,45,45,1) 0%,rgba(53,35,35,1) 100%); } \ No newline at end of file diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html index 661a1582..9d406d0b 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.html +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html @@ -56,7 +56,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "module": "montage/ui/button.reel", "name": "Button", "properties": { - "element": {"#": "editbutton"}, + "element": {"#": "edit-button"}, "identifier": "editButton", "label": " " }, @@ -75,11 +75,13 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
- +
- + + +
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js index 2396d625..4f9ad21f 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.js +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js @@ -8,36 +8,42 @@ var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; exports.StyleSheet = Montage.create(Component, { - deserializedFromTemplate : { - value: function() { - console.log("style sheet view - deserialized"); - } + _translateDistance: { + value: null }, + willDraw : { value: function() { console.log("style sheet view - will draw"); if(this.editing) { - document.body.addEventListener('click', this, false); + document.body.addEventListener('mousedown', this, false); + this._translateDistance = this._element.offsetWidth - this.editButton._element.offsetWidth; + } else { - document.body.removeEventListener('click', this, false); + document.body.removeEventListener('mousedown', this, false); } } }, draw : { value: function() { + var transStr = '-webkit-transform'; console.log("styles sheet view - draw"); this.mediaInput.value = this._source.media.mediaText; if(this.editing) { this.editView.classList.add('expanded'); + this.editView.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); } else { this.editView.classList.remove('expanded'); + this.editView.style.removeProperty(transStr); } } }, + + handleEditButtonAction: { value: function(e) { console.log('handle edit button action'); @@ -57,10 +63,10 @@ exports.StyleSheet = Montage.create(Component, { } }, - handleClick : { + handleMousedown : { value: function(e) { - console.log("handle click"); - if(e.target !== this.editView) { + console.log("handle mousedown"); + if(e.target !== this.editView && e.target !== this.editButton) { this.editing = false; } } @@ -89,7 +95,7 @@ exports.StyleSheet = Montage.create(Component, { return this._source; }, set: function(sheet) { - console.log('sheet being set'); + console.log('sheet being set: ', sheet.ownerNode); if(sheet.href) { this.name = sheet.href.substring(sheet.href.lastIndexOf('/')+1); } else { -- cgit v1.2.3