mirror of
https://github.com/jasny/bootstrap.git
synced 2026-04-24 03:00:49 -04:00
fix csp warning about unsafe-inline style-src
Showing and hiding an off-canvas menu with content-security-policy enabled (via ember-cli) results in the following~
[Report Only] Refused to apply inline style because it violates the following Content Security Policy directive~
Changing the way that OffCanvas.hide() restors the style addresses this warning. e.g., `$(this).attr('style', ...)`~
For more information about content-security-policy, see http://content-security-policy.com/.
This commit is contained in:
@@ -236,7 +236,8 @@
|
||||
|
||||
elements.removeClass('canvas-sliding')
|
||||
elements.add(this.$element).add('body').each(function() {
|
||||
$(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style')
|
||||
$(this).style = $(this).data('offcanvas-style')
|
||||
$(this).removeData('offcanvas-style')
|
||||
})
|
||||
|
||||
this.$element.trigger('hidden.bs.offcanvas')
|
||||
|
||||
Reference in New Issue
Block a user