@@ -72,9 +72,9 @@ var FlexDashboard = (function () {
72
72
globalSidebar . addClass ( 'level3' ) ;
73
73
var h1 = globalSidebar . children ( 'h1' ) ;
74
74
var h3 = $ ( '<h3></h3>' ) ;
75
- h3 . html ( h1 . html ( ) ) ;
75
+ h3 . append ( h1 . contents ( ) ) ;
76
76
h3 . insertBefore ( h1 ) ;
77
- h1 . remove ( ) ;
77
+ h1 . detach ( ) ;
78
78
79
79
// move it into the first page
80
80
var page = dashboardContainer . find ( '.section.level1' ) . first ( ) ;
@@ -261,10 +261,10 @@ var FlexDashboard = (function () {
261
261
if ( active )
262
262
wrapper . addClass ( 'active' ) ;
263
263
264
- // get a reference to the h1, discover it's id and title , then remove it
264
+ // get a reference to the h1, discover its inner contens , then detach it
265
265
var h1 = wrapper . find ( 'h1' ) . first ( ) ;
266
- var title = h1 . html ( ) ;
267
- h1 . remove ( ) ;
266
+ var title = h1 . contents ( ) ;
267
+ h1 . detach ( ) ;
268
268
269
269
// create a navbar item
270
270
var li = $ ( '<li></li>' ) ;
@@ -402,9 +402,9 @@ var FlexDashboard = (function () {
402
402
sidebar . wrapInner ( '<div class="section level3"></div>' ) ;
403
403
var h2 = sidebar . find ( 'h2' ) ;
404
404
var h3 = $ ( '<h3></h3>' ) ;
405
- h3 . html ( h2 . html ( ) ) ;
405
+ h3 . append ( h2 . contents ( ) ) ;
406
406
h3 . insertBefore ( h2 ) ;
407
- h2 . remove ( ) ;
407
+ h2 . detatch ( ) ;
408
408
409
409
// wipeout h2 elements then enclose them in a single h2
410
410
var level2 = page . find ( 'div.section.level2' ) ;
@@ -546,8 +546,8 @@ var FlexDashboard = (function () {
546
546
// extract the title from the h3
547
547
var li = $ ( '<li></li>' ) ;
548
548
var h3 = frame . children ( 'h3' ) ;
549
- li . html ( h3 . html ( ) ) ;
550
- h3 . remove ( ) ;
549
+ li . append ( h3 . contents ( ) ) ;
550
+ h3 . detach ( ) ;
551
551
ul . append ( li ) ;
552
552
553
553
// extract commentary
@@ -943,7 +943,7 @@ var FlexDashboard = (function () {
943
943
944
944
// add the title
945
945
var chartTitle = $ ( '<div class="chart-title"></div>' ) ;
946
- chartTitle . html ( title ) ;
946
+ chartTitle . append ( title ) ;
947
947
chart . prepend ( chartTitle ) ;
948
948
949
949
// add the notes section
@@ -999,10 +999,11 @@ var FlexDashboard = (function () {
999
999
1000
1000
// get the heading element within it and grab it's text
1001
1001
var heading = tab . find ( 'h' + tabLevel + ':first' ) ;
1002
- var headingText = heading . html ( ) ;
1002
+ var headingDom = heading . contents ( ) ;
1003
1003
1004
1004
// build and append the tab list item
1005
- var a = $ ( '<a role="tab" data-toggle="tab">' + headingText + '</a>' ) ;
1005
+ var a = $ ( '<a role="tab" data-toggle="tab"></a>' ) ;
1006
+ a . append ( headingDom ) ;
1006
1007
a . attr ( 'href' , '#' + id ) ;
1007
1008
a . attr ( 'aria-controls' , id ) ;
1008
1009
var li = $ ( '<li role="presentation"></li>' ) ;
@@ -1125,8 +1126,8 @@ var FlexDashboard = (function () {
1125
1126
var h3 = container . children ( 'h3' ) . first ( ) ;
1126
1127
var title = '' ;
1127
1128
if ( ! container . hasClass ( 'no-title' ) )
1128
- title = h3 . html ( ) ;
1129
- h3 . remove ( ) ;
1129
+ title = h3 . contents ( ) ;
1130
+ h3 . detach ( ) ;
1130
1131
return title ;
1131
1132
}
1132
1133
@@ -1137,11 +1138,11 @@ var FlexDashboard = (function () {
1137
1138
var caption = chartContent . children ( 'div.image-container' )
1138
1139
. children ( 'p.caption' ) ;
1139
1140
if ( blockquote . length ) {
1140
- chartNotes . html ( blockquote . children ( 'p:first-child' ) . html ( ) ) ;
1141
+ chartNotes . empty ( ) . append ( blockquote . children ( 'p:first-child' ) . contents ( ) ) ;
1141
1142
blockquote . remove ( ) ;
1142
1143
return true ;
1143
1144
} else if ( caption . length ) {
1144
- chartNotes . html ( caption . html ( ) ) ;
1145
+ chartNotes . empty ( ) . append ( caption . contents ( ) ) ;
1145
1146
caption . remove ( ) ;
1146
1147
return true ;
1147
1148
} else {
@@ -1671,7 +1672,7 @@ window.FlexDashboardComponents.push({
1671
1672
1672
1673
// caption
1673
1674
var caption = $ ( '<p class="caption"></p>' ) ;
1674
- caption . html ( chartTitle ) ;
1675
+ caption . append ( chartTitle ) ;
1675
1676
1676
1677
// build inner div for value box and add it
1677
1678
var inner = $ ( '<div class="inner"></div>' ) ;
@@ -1772,5 +1773,3 @@ window.FlexDashboardComponents.push({
1772
1773
) ;
1773
1774
}
1774
1775
} ) ;
1775
-
1776
-
0 commit comments