Skip to content

Commit

Permalink
remove required buttons options (#237)
Browse files Browse the repository at this point in the history
* remove required buttons options

* add assertion on buttons value

* builtInButtons
  • Loading branch information
chuckcarpenter authored and RobbieTheWagner committed Sep 7, 2018
1 parent 06b8913 commit e2dfb32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addon/services/tour.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit e2dfb32

Please sign in to comment.