From 84a7674e4f6556b8663f94a5360c29a5a276f2c8 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 18 Jul 2012 23:04:37 -0700 Subject: Preview button: enabling the entire button to handle a mouse click - Then entire button area (button and icon) is not click enabled to launch a Chrome Preview instead of only the actual button. Signed-off-by: Valerio Virgillito --- js/components/layout/document-bar.reel/document-bar.html | 13 ++++--------- js/components/layout/document-bar.reel/document-bar.js | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/js/components/layout/document-bar.reel/document-bar.html b/js/components/layout/document-bar.reel/document-bar.html index ccf759ef..3e3ac936 100755 --- a/js/components/layout/document-bar.reel/document-bar.html +++ b/js/components/layout/document-bar.reel/document-bar.html @@ -75,13 +75,7 @@ POSSIBILITY OF SUCH DAMAGE. "element": {"#": "previewButton"}, "identifier": "preview", "label": "Preview" - }, - "listeners": [ - { - "type": "action", - "listener": {"@": "owner"} - } - ] + } }, "owner": { @@ -90,7 +84,8 @@ POSSIBILITY OF SUCH DAMAGE. "element": {"#": "documentBar"}, "zoomControl": {"@": "hottext1"}, "btnDesign": {"#": "buttonDesign"}, - "btnCode": {"#": "buttonCode"} + "btnCode": {"#": "buttonCode"}, + "btnPreview": {"#": "buttonPreview"} } } } @@ -126,7 +121,7 @@ POSSIBILITY OF SUCH DAMAGE. -
+
diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index a9c98507..5623f825 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -65,6 +65,17 @@ exports.DocumentBar = Montage.create(Component, { }, //////////////////////////////////////////////////////////////////// // + btnCode: { + value: null + }, + btnDesign: { + value: null + }, + btnPreview: { + value: null + }, + //////////////////////////////////////////////////////////////////// + // _visible: { value: false }, @@ -113,6 +124,7 @@ exports.DocumentBar = Montage.create(Component, { // this.btnCode.addEventListener('click', this.showViewCode.bind(this), false); this.btnDesign.addEventListener('click', this.showViewDesign.bind(this), false); + this.btnPreview.addEventListener('click', this, false); } }, //////////////////////////////////////////////////////////////////// @@ -207,8 +219,8 @@ exports.DocumentBar = Montage.create(Component, { } }, - handlePreviewAction: { - value: function(event) { + handleClick: { + value: function(evt) { NJevent("executePreview"); } } -- cgit v1.2.3