diff options
| author | rr- | 2016-11-27 21:52:40 +0100 |
|---|---|---|
| committer | rr- | 2016-11-27 22:05:12 +0100 |
| commit | 6bf5764c6ce49cb0c8a1f609d7e28b8a81f74326 (patch) | |
| tree | 68c498a72b58f455fb70121c39998ccc9c8524fd /client/js | |
| parent | 9ae2b6aa4457217ff88eaaa44bfe886d6cb8d998 (diff) | |
client/posts: fix adding loop flag to non videos
Diffstat (limited to 'client/js')
| -rw-r--r-- | client/js/views/post_upload_view.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/js/views/post_upload_view.js b/client/js/views/post_upload_view.js index b260381..51a035c 100644 --- a/client/js/views/post_upload_view.js +++ b/client/js/views/post_upload_view.js @@ -30,7 +30,7 @@ class Uploadable extends events.EventTarget { constructor() { super(); this.safety = 'safe'; - this.flags = ['loop']; + this.flags = []; this.anonymous = false; this.order = globalOrder; globalOrder++; @@ -54,6 +54,12 @@ class Uploadable extends events.EventTarget { get name() { throw new Error('Not implemented'); } + + _initComplete() { + if (['video'].includes(this.type)) { + this.flags.push('loop'); + } + } } class File extends Uploadable { @@ -73,6 +79,7 @@ class File extends Uploadable { new CustomEvent('finish', {detail: {uploadable: this}})); }); } + this._initComplete(); } destroy() { @@ -103,6 +110,7 @@ class Url extends Uploadable { super(); this.url = url; this.dispatchEvent(new CustomEvent('finish')); + this._initComplete(); } get mimeType() { |