From efff6f62aee624c2228d2f2cef7894b3142b1ea2 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Wed, 17 Feb 2016 22:24:16 -0600 Subject: [PATCH] pass post tags as array to ember-cli-selectize closes #6483 - fix new post => settings/tags transition error --- core/client/app/controllers/post-settings-menu.js | 5 +++++ core/client/app/templates/post-settings-menu.hbs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/client/app/controllers/post-settings-menu.js b/core/client/app/controllers/post-settings-menu.js index 3662eefd1d..a8a544a579 100644 --- a/core/client/app/controllers/post-settings-menu.js +++ b/core/client/app/controllers/post-settings-menu.js @@ -174,6 +174,11 @@ export default Controller.extend(SettingsMenuMixin, { this.set('debounceId', debounceId); }, + // this exists because selectize throws errors on transition if it doesn't + existingTags: computed('model.tags.[]', function () { + return this.get('model.tags').toArray(); + }), + // live-query of all tags for tag input autocomplete availableTags: computed(function () { return this.get('store').filter('tag', {limit: 'all'}, () => { diff --git a/core/client/app/templates/post-settings-menu.hbs b/core/client/app/templates/post-settings-menu.hbs index 9b6e68298f..7c47a8812b 100644 --- a/core/client/app/templates/post-settings-menu.hbs +++ b/core/client/app/templates/post-settings-menu.hbs @@ -41,7 +41,7 @@ {{gh-selectize id="tag-input" multiple=true - selection=model.tags + selection=existingTags content=availableTags optionValuePath="content.uuid" optionLabelPath="content.name"