X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=ang%2FcrmUi.js;h=f80ce39f18b6e6eafe391e89f4fb119d7e2f13d8;hb=4f87ec96e8ba594ad1705a8806999bd0bc976bb0;hp=24c7dceb42429380c3fde5b57d0b18e70d7a3a91;hpb=fd57b1d3afbbe9b63a82a0864728b79f94d3f4e1;p=civicrm-core.git diff --git a/ang/crmUi.js b/ang/crmUi.js index 24c7dceb42..f80ce39f18 100644 --- a/ang/crmUi.js +++ b/ang/crmUi.js @@ -6,7 +6,7 @@ angular.module('crmUi', []) // example
...content...
- // WISHLIST: crmCollapsed should support two-way/continous binding + // WISHLIST: crmCollapsed should support two-way/continuous binding .directive('crmUiAccordion', function() { return { scope: { @@ -314,10 +314,12 @@ // Display an HTML blurb inside an IFRAME. // example: + // example: .directive('crmUiIframe', function ($parse) { return { scope: { - crmUiIframe: '@' // expression which evalutes to HTML content + crmUiIframeSrc: '@', // expression which evaluates to a URL + crmUiIframe: '@' // expression which evaluates to HTML content }, link: function (scope, elm, attrs) { var iframe = $(elm)[0]; @@ -325,20 +327,24 @@ iframe.setAttribute('frameborder', '0'); var refresh = function () { - // var iframeHtml = ''; - var iframeHtml = scope.$parent.$eval(attrs.crmUiIframe); - - var doc = iframe.document; - if (iframe.contentDocument) { - doc = iframe.contentDocument; - } - else if (iframe.contentWindow) { - doc = iframe.contentWindow.document; + if (attrs.crmUiIframeSrc) { + iframe.setAttribute('src', scope.$parent.$eval(attrs.crmUiIframeSrc)); } + else { + var iframeHtml = scope.$parent.$eval(attrs.crmUiIframe); + + var doc = iframe.document; + if (iframe.contentDocument) { + doc = iframe.contentDocument; + } + else if (iframe.contentWindow) { + doc = iframe.contentWindow.document; + } - doc.open(); - doc.writeln(iframeHtml); - doc.close(); + doc.open(); + doc.writeln(iframeHtml); + doc.close(); + } }; // If the iframe is in a dialog, respond to resize events @@ -355,31 +361,13 @@ // Example: //