* @function * @memberof Modifiers * @argument {Object} data - The data object generated by `update` method * @argument {Object} data.styles - List of style properties - values to apply to popper element * @argument {Object} data.attributes - List of attribute properties - values to apply to popp
(data)
| 4150 | |
| 4151 | |
| 4152 | function applyStyle(data) { |
| 4153 | // any property present in `data.styles` will be applied to the popper, |
| 4154 | // in this way we can make the 3rd party modifiers add custom styles to it |
| 4155 | // Be aware, modifiers could override the properties defined in the previous |
| 4156 | // lines of this modifier! |
| 4157 | setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper, |
| 4158 | // they will be set as HTML attributes of the element |
| 4159 | |
| 4160 | setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties |
| 4161 | |
| 4162 | if (data.arrowElement && Object.keys(data.arrowStyles).length) { |
| 4163 | setStyles(data.arrowElement, data.arrowStyles); |
| 4164 | } |
| 4165 | |
| 4166 | return data; |
| 4167 | } |
| 4168 | /** |
| 4169 | * Set the x-placement attribute before everything else because it could be used |
| 4170 | * to add margins to the popper margins needs to be calculated to get the |
nothing calls this directly
no test coverage detected
searching dependent graphs…