From 3d7f737c491f419f535657ef27539555b8c6db85 Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 3 Feb 2017 15:07:37 +0900 Subject: [PATCH 1/2] Use "Zoom to fit" as default --- lib/image-editor-view.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/image-editor-view.coffee b/lib/image-editor-view.coffee index 6215165..9324930 100644 --- a/lib/image-editor-view.coffee +++ b/lib/image-editor-view.coffee @@ -20,9 +20,9 @@ class ImageEditorView extends ScrollView @button class: 'btn reset-zoom-button', outlet: 'resetZoomButton', '100%' @button class: 'btn', outlet: 'zoomInButton', '+' @div class: 'image-controls-group btn-group', => - @button class: 'btn', outlet: 'zoomToFitButton', 'Zoom to fit' + @button class: 'btn selected', outlet: 'zoomToFitButton', 'Zoom to fit' - @div class: 'image-container', background: 'white', outlet: 'imageContainer', => + @div class: 'image-container zoom-to-fit', background: 'white', outlet: 'imageContainer', => @img outlet: 'image' initialize: (@editor) -> @@ -34,7 +34,7 @@ class ImageEditorView extends ScrollView @disposables = new CompositeDisposable @loaded = false - @mode = 'reset-zoom' + @mode = 'zoom-to-fit' @image.hide() @updateImageURI() From ce03136a78ec50f80a567d082ff6cbd508316203 Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 3 Feb 2017 15:11:41 +0900 Subject: [PATCH 2/2] Disable zoom-to-fit-button once selected --- lib/image-editor-view.coffee | 4 ++-- styles/image-view.less | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/image-editor-view.coffee b/lib/image-editor-view.coffee index 9324930..3b7074c 100644 --- a/lib/image-editor-view.coffee +++ b/lib/image-editor-view.coffee @@ -17,10 +17,10 @@ class ImageEditorView extends ScrollView @text 'transparent' @div class: 'image-controls-group btn-group', => @button class: 'btn', outlet: 'zoomOutButton', '-' - @button class: 'btn reset-zoom-button', outlet: 'resetZoomButton', '100%' + @button class: 'btn reset-zoom-button', outlet: 'resetZoomButton', 'Auto' @button class: 'btn', outlet: 'zoomInButton', '+' @div class: 'image-controls-group btn-group', => - @button class: 'btn selected', outlet: 'zoomToFitButton', 'Zoom to fit' + @button class: 'btn zoom-to-fit-button selected', outlet: 'zoomToFitButton', 'Zoom to fit' @div class: 'image-container zoom-to-fit', background: 'white', outlet: 'imageContainer', => @img outlet: 'image' diff --git a/styles/image-view.less b/styles/image-view.less index a01cae9..b5c2e54 100644 --- a/styles/image-view.less +++ b/styles/image-view.less @@ -60,6 +60,12 @@ .reset-zoom-button { min-width: 5em; } + + // disabled once the button is selected + .zoom-to-fit-button.selected { + pointer-events: none; + cursor: default; + } }