This commit is contained in:
syuilo
2018-02-09 13:11:30 +09:00
parent d1aba96a29
commit 92a1429de9
38 changed files with 308 additions and 328 deletions

View File

@ -57,12 +57,12 @@
</style>
<script lang="typescript">
this.cancel = () => {
this.trigger('canceled');
this.$emit('canceled');
this.$destroy();
};
this.ok = () => {
this.trigger('selected', this.$refs.browser.folder);
this.$emit('selected', this.$refs.browser.folder);
this.$destroy();
};
</script>

View File

@ -70,18 +70,18 @@
});
this.$refs.browser.on('selected', file => {
this.trigger('selected', file);
this.$emit('selected', file);
this.$destroy();
});
});
this.cancel = () => {
this.trigger('canceled');
this.$emit('canceled');
this.$destroy();
};
this.ok = () => {
this.trigger('selected', this.files);
this.$emit('selected', this.files);
this.$destroy();
};
</script>

View File

@ -274,7 +274,7 @@
if (folder.parent) dive(folder.parent);
this.update();
this.trigger('open-folder', this.folder, silent);
this.$emit('open-folder', this.folder, silent);
this.fetch();
});
};
@ -343,7 +343,7 @@
folder: null,
hierarchyFolders: []
});
this.trigger('move-root');
this.$emit('move-root');
this.fetch();
}
@ -359,7 +359,7 @@
fetching: true
});
this.trigger('begin-fetch');
this.$emit('begin-fetch');
let fetchedFolders = null;
let fetchedFiles = null;
@ -402,11 +402,11 @@
fetching: false
});
// 一連の読み込みが完了したイベントを発行
this.trigger('fetched');
this.$emit('fetched');
} else {
flag = true;
// 一連の読み込みが半分完了したイベントを発行
this.trigger('fetch-mid');
this.$emit('fetch-mid');
}
};
@ -455,9 +455,9 @@
this.selectedFiles.push(file);
}
this.update();
this.trigger('change-selection', this.selectedFiles);
this.$emit('change-selection', this.selectedFiles);
} else {
this.trigger('selected', file);
this.$emit('selected', file);
}
} else {
this.cf(file);
@ -482,7 +482,7 @@
if (file.folder) dive(file.folder);
this.update();
this.trigger('open-file', this.file, silent);
this.$emit('open-file', this.file, silent);
});
};

View File

@ -22,7 +22,7 @@
this.init = new Promise((res, rej) => {
this.api('posts/timeline').then(posts => {
res(posts);
this.trigger('loaded');
this.$emit('loaded');
});
});

View File

@ -16,7 +16,7 @@
<script lang="typescript">
this.on('mount', () => {
this.$refs.tl.on('loaded', () => {
this.trigger('loaded');
this.$emit('loaded');
});
});
</script>

View File

@ -106,7 +106,7 @@
notifications: notifications
});
this.trigger('fetched');
this.$emit('fetched');
});
this.connection.on('notification', this.onNotification);

View File

@ -161,7 +161,7 @@
});
this.$refs.uploader.on('change-uploads', uploads => {
this.trigger('change-uploading-files', uploads);
this.$emit('change-uploading-files', uploads);
});
this.$refs.text.focus();
@ -207,19 +207,19 @@
this.addFile = file => {
file._remove = () => {
this.files = this.files.filter(x => x.id != file.id);
this.trigger('change-files', this.files);
this.$emit('change-files', this.files);
this.update();
};
this.files.push(file);
this.trigger('change-files', this.files);
this.$emit('change-files', this.files);
this.update();
};
this.removeFile = e => {
const file = e.item;
this.files = this.files.filter(x => x.id != file.id);
this.trigger('change-files', this.files);
this.$emit('change-files', this.files);
this.update();
};
@ -254,7 +254,7 @@
reply_id: opts.reply ? opts.reply.id : undefined,
poll: this.poll ? this.$refs.poll.get() : undefined
}).then(data => {
this.trigger('post');
this.$emit('post');
this.$destroy();
}).catch(err => {
this.update({
@ -264,7 +264,7 @@
};
this.cancel = () => {
this.trigger('cancel');
this.$emit('cancel');
this.$destroy();
};

View File

@ -27,7 +27,7 @@
this.init = new Promise((res, rej) => {
this.api('posts/search', parse(this.query)).then(posts => {
res(posts);
this.trigger('loaded');
this.$emit('loaded');
});
});

View File

@ -9,7 +9,7 @@
this.on('mount', () => {
this.$refs.posts.on('loaded', () => {
this.trigger('loaded');
this.$emit('loaded');
});
});
</script>

View File

@ -21,7 +21,7 @@
this.on('mount', () => {
this.$refs.list.on('loaded', () => {
this.trigger('loaded');
this.$emit('loaded');
});
});
</script>

View File

@ -21,7 +21,7 @@
this.on('mount', () => {
this.$refs.list.on('loaded', () => {
this.trigger('loaded');
this.$emit('loaded');
});
});
</script>

View File

@ -18,7 +18,7 @@
with_media: this.withMedia
}).then(posts => {
res(posts);
this.trigger('loaded');
this.$emit('loaded');
});
});

View File

@ -201,7 +201,7 @@
}).then(user => {
this.fetching = false;
this.user = user;
this.trigger('loaded', user);
this.$emit('loaded', user);
this.update();
});
});

View File

@ -87,7 +87,7 @@
this.moreFetching = false;
this.on('mount', () => {
this.fetch(() => this.trigger('loaded'));
this.fetch(() => this.$emit('loaded'));
});
this.fetch = cb => {