Use ternary notation

This follows up on https://github.com/openlayers/ol3/pull/2856#issuecomment-60559544.