MCPcopy Create free account
hub / github.com/SpringRoll/SpringRoll / _applyRemainingDefaultOptions

Function _applyRemainingDefaultOptions

docs/assets/anchor.js:34–45  ·  view source on GitHub ↗

* Assigns options to the internal options object, and provides defaults. * @param {Object} opts - Options object

(opts)

Source from the content-addressed store, hash-verified

32 * @param {Object} opts - Options object
33 */
34 function _applyRemainingDefaultOptions(opts) {
35 opts.icon = opts.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'.
36 opts.visible = opts.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' & 'touch'
37 opts.placement = opts.hasOwnProperty('placement')
38 ? opts.placement
39 : 'right'; // Also accepts 'left'
40 opts.class = opts.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name.
41 // Using Math.floor here will ensure the value is Number-cast and an integer.
42 opts.truncate = opts.hasOwnProperty('truncate')
43 ? Math.floor(opts.truncate)
44 : 64; // Accepts any value that can be typecast to a number.
45 }
46
47 _applyRemainingDefaultOptions(this.options);
48

Callers 1

AnchorJSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected