From 13725f040bca346a7b35b832f36f4e86c5da11e4 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Thu, 7 Feb 2019 03:05:59 -0500
Subject: Add avatar crop popup

---
 src/components/image_cropper/image_cropper.vue | 39 ++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 src/components/image_cropper/image_cropper.vue

(limited to 'src/components/image_cropper/image_cropper.vue')

diff --git a/src/components/image_cropper/image_cropper.vue b/src/components/image_cropper/image_cropper.vue
new file mode 100644
index 00000000..1c52842c
--- /dev/null
+++ b/src/components/image_cropper/image_cropper.vue
@@ -0,0 +1,39 @@
+<template>
+  <div class="image-cropper">
+    <modal :show="dataUrl" :title="title" @close="destroy">
+      <div class="modal-body">
+        <div class="image-cropper-image-container">
+          <img ref="img" :src="dataUrl" alt="" @load.stop="createCropper" />
+        </div>
+      </div>
+      <div class="modal-footer">
+        <button class="btn image-cropper-btn" type="button" @click="submit" v-text="saveButtonLabel"></button>
+      </div>
+    </modal>
+    <input ref="input" type="file" class="image-cropper-img-input" :accept="mimes">
+  </div>
+</template>
+
+<script src="./image_cropper.js"></script>
+
+<style lang="scss">
+.image-cropper {
+  &-img-input {
+    display: none;
+  }
+
+  &-image-container {
+    position: relative;
+
+    img {
+      display: block;
+      max-width: 100%;
+    }
+  }
+
+  &-btn {
+    display: block;
+    width: 100%;
+  }
+}
+</style>
-- 
cgit v1.2.3-70-g09d2

