* Assigns options to the internal options object, and provides defaults. * @param {Object} opts - Options object
(opts)
| 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 |