Skip to content

Commit

Permalink
Merge pull request #38 from sandeepchhapola/master
Browse files Browse the repository at this point in the history
Made required changes for pivotal issue: #115494479
  • Loading branch information
DanielHindi committed Mar 14, 2016
2 parents 5ce3f69 + 770ef97 commit 15794ab
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions widget/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@
*/
.filter('safeHtml', ['$sce', function ($sce) {
return function (html) {
if (html) {
return $sce.trustAsHtml(html);
}
else {
if (html) {
var $html = $('<div />', {html: html});
$html.find('iframe').each(function (index, element) {
var src = element.src;
console.log('element is: ', src, src.indexOf('http'));
src = src && src.indexOf('file://') != -1 ? src.replace('file://', 'http://') : src;
element.src = src && src.indexOf('http') != -1 ? src : 'http:' + src;
});
return $sce.trustAsHtml($html.html());
} else {
return "";
}
};
Expand Down

0 comments on commit 15794ab

Please sign in to comment.