Skip to content

Commit 1871f49

Browse files
author
minjk-bl
committed
vpCommon > loadCssForDiv - as applying style partially
1 parent 8157042 commit 1871f49

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/common/vpCommon.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ define([
6969
document.getElementsByTagName("head")[0].appendChild(link);
7070
}
7171

72+
/**
73+
* append css for div
74+
* @param {string} divSelector
75+
* @param {string} url
76+
*/
77+
var loadCssForDiv = function(divSelector, url) {
78+
$('<link>')
79+
.appendTo(divSelector)
80+
.attr({
81+
type: 'text/css',
82+
rel: 'stylesheet',
83+
href: requirejs.toUrl(url)
84+
});
85+
}
86+
7287
/**
7388
* VisualPython container selector (jquery selector)
7489
* @returns vp top container selector
@@ -347,6 +362,7 @@ define([
347362
loadHtml: loadHtml
348363
, getUUID: getUUID
349364
, loadCss: loadCss
365+
, loadCssForDiv: loadCssForDiv
350366
, getVPContainer: getVPContainer
351367
, wrapSelector: wrapSelector
352368
, addVariable: addVariable

0 commit comments

Comments
 (0)