From 4fa08fe2ce439a5f5c248c568f72d3828ee11b36 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 11:43:55 -0700 Subject: fix for the document tab close button and rulers on initial document Signed-off-by: Valerio Virgillito --- .../layout/document-entry.reel/close_button.gif | Bin 139 -> 0 bytes .../layout/document-entry.reel/document-entry.css | 8 ++--- .../layout/document-entry.reel/document-entry.html | 15 ++++++--- .../layout/document-entry.reel/document-entry.js | 37 ++++----------------- 4 files changed, 20 insertions(+), 40 deletions(-) delete mode 100755 js/components/layout/document-entry.reel/close_button.gif (limited to 'js/components/layout') diff --git a/js/components/layout/document-entry.reel/close_button.gif b/js/components/layout/document-entry.reel/close_button.gif deleted file mode 100755 index 00b5904b..00000000 Binary files a/js/components/layout/document-entry.reel/close_button.gif and /dev/null differ diff --git a/js/components/layout/document-entry.reel/document-entry.css b/js/components/layout/document-entry.reel/document-entry.css index 010e1da7..6a2900be 100755 --- a/js/components/layout/document-entry.reel/document-entry.css +++ b/js/components/layout/document-entry.reel/document-entry.css @@ -19,17 +19,13 @@ min-width:0px; } -.mybutton { +.documentCloseButton { display: inline; -webkit-appearance: none; outline: none; - - font-size: 9px; cursor: pointer; border: 0px; - background-color: #474747; - background-image: -webkit-linear-gradient(top, #505050 0%, #3c3c3c 100%); - + background: #474747 url(../../../../images/documentsTab/close_button.gif) center center no-repeat; } .documentEntry button { diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html index bd8c25cb..e68d17c5 100755 --- a/js/components/layout/document-entry.reel/document-entry.html +++ b/js/components/layout/document-entry.reel/document-entry.html @@ -22,8 +22,16 @@ "closeButton": { "prototype": "montage/ui/button.reel", "properties": { - "element": {"#": "close-btn"} - } + "element": {"#": "close-btn"}, + "identifier": "closeButton" + }, + "listeners": [ + { + "type": "action", + "listener": {"@": "owner"}, + "capture": false + } + ] } } @@ -31,8 +39,7 @@
  • - - +
  • \ No newline at end of file diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index 2e66c7cd..34e307cb 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -9,15 +9,11 @@ var Component = require("montage/ui/component").Component; exports.DocumentEntry = Montage.create(Component, { - dirty: { value: null }, - _uuid: { - value: null, - enumerable: false + value: null }, _document: { - enumerable: false, value: null }, @@ -40,7 +36,9 @@ exports.DocumentEntry = Montage.create(Component, { } }, - _name: { value: null }, + _name: { + value: null + }, name: { enumerable: false, @@ -74,22 +72,11 @@ exports.DocumentEntry = Montage.create(Component, { } }, - prepareForDraw: { - enumerable: false, - value: function() { -// this.element.addEventListener("click", this, false); -// this.closeBtn.addEventListener("click", this, true); - } - }, - - draw: { enumerable: false, value: function() { this.label.innerText = this._name ? this._name : ""; -// this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); - if(this.saveFlag) { this.label.classList.add("dirty"); } else { @@ -98,19 +85,9 @@ exports.DocumentEntry = Montage.create(Component, { } }, - captureClick: { - value: function(event) { - console.log("clicked on the X"); - event.preventDefault(); - event.stopImmediatePropagation(); - event.stopPropagation(); -// if(event._event.target.nodeName === "IMG") { -// this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); -// } else { -// if(!this.active) { -// this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid)); -// } -// } + handleCloseButtonAction: { + value: function() { + //this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } } -- cgit v1.2.3