From e2dfb324842b6aea4239b98b199844061984f327 Mon Sep 17 00:00:00 2001 From: Chuck Carpenter Date: Fri, 7 Sep 2018 16:44:53 -0700 Subject: [PATCH] remove required buttons options (#237) * remove required buttons options * add assertion on buttons value * builtInButtons --- addon/services/tour.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addon/services/tour.js b/addon/services/tour.js index fa331d39..8fe8e156 100644 --- a/addon/services/tour.js +++ b/addon/services/tour.js @@ -1,5 +1,5 @@ /* eslint-disable ember/avoid-leaking-state-in-ember-objects, ember/no-observers */ - +import { assert } from '@ember/debug'; import { get, observer, set } from '@ember/object'; import { isEmpty, isPresent } from '@ember/utils'; import Service from '@ember/service'; @@ -336,7 +336,8 @@ export default Service.extend(Evented, { steps.forEach((step, index) => { const { id, options } = step; - options.buttons = options.builtInButtons.map(this.makeButton, this); + assert('You must either pass an array of builtInButtons or `false`, undefined is not supported', options.builtInButtons !== undefined); + options.buttons = (options.builtInButtons !== false) ? options.builtInButtons.map(this.makeButton, this) : false; options.attachTo = this.normalizeAttachTo(options.attachTo); tour.addStep(id, options);