0 votes
by (350 points)
Hey, I'd like to remove only the back and forward arrows from the sidebar, so that when you get to a new passage, you can't go back to the previous one without restarting.

2 Answers

+1 vote
by (68.6k points)
selected by
 
Best answer

If you only want to disable the history controls, then you may use the Config.history.controls configuration property.  For example: (goes in Story JavaScript)

Config.history.controls = false;

 

Alternatively.  If you never plan on using the story history at all, then you're better off limiting it to a single moment via the Config.history.maxStates configuration property, which also has the effect of disabling the history controls.  For example: (goes in Story JavaScript)

Config.history.maxStates = 1;

 

Either way, you only need to use one of those options.

+1 vote
by (8.9k points)

Choose Edit Story JavaScript and paste this in there:

config.history.controls = false;

 

by (68.6k points)

No.  The config object is a deprecated v1 compatibility shim.  See: Config.history.controls.

by (8.9k points)

Huh?  It seemed to work fine when I tested it.  Is the difference Config rather than config?

by (68.6k points)

It worked because, as I noted, it's a compatibility shim in v2.  As I also noted, it's deprecated, which means it's on life support (i.e. depend upon it at your own peril).

The difference between the base objects is, yes, the spelling (i.e. Config vs. config).  That is, however, not the only difference.  If you're using config because you're familiar with the v1 object or are just looking at outdated examples, I suggest looking at the SugarCube v2 upgrade instructions, specifically, and its full documentation, in general.

by (8.9k points)
I see, thanks Exile.
...