aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_upload/media_upload.vue
blob: c8865d777388b085f62d30e0b035150d0987012e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
  <div
    class="media-upload"
    :class="{ disabled: disabled }"
  >
    <label
      class="label"
      :title="$t('tool_tip.media_upload')"
    >
      <i
        v-if="uploading"
        class="progress-icon icon-spin4 animate-spin"
      />
      <i
        v-if="!uploading"
        class="new-icon icon-upload"
      />
      <input
        v-if="uploadReady"
        :disabled="disabled"
        type="file"
        style="position: fixed; top: -100em"
        multiple="true"
        @change="change"
      >
    </label>
  </div>
</template>

<script src="./media_upload.js" ></script>

<style lang="scss">
@import '../../_variables.scss';

.media-upload {
  .label {
    display: inline-block;
  }

  .new-icon {
    cursor: pointer;
  }

  .progress-icon {
    display: inline-block;
    line-height: 0;
    &::before {
      /* Overriding fontello to achieve the perfect speeeen */
      margin: 0;
      line-height: 0;
    }
  }
}
 </style>