Skip to content

Commit

Permalink
Only append style tag if it doesn't already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewchilds authored and liviucmg committed Apr 25, 2017
1 parent a847d99 commit f3e9028
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/theia-sticky-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
options.initialized = true;

// Add CSS
$('head').append($('<style>.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>'));
var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace);
if (existingStylesheet.length === 0) {
$('head').append($('<style id="theia-sticky-sidebar-stylesheet-' + options.namespace + '">.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>'));
}

$that.each(function () {
var o = {};
Expand Down

0 comments on commit f3e9028

Please sign in to comment.