aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_upload/media_upload.vue
blob: d719eae152bac0ffb2e0add9f471b68e0afcb4f8 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
<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 {
  &.disabled {
    .new-icon {
      cursor: not-allowed;
    }

    &:hover {
      i, label {
        color: $fallback--faint;
        color: var(--faint, $fallback--faint);
      }
    }
  }

  .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>