Skip to content

Commit

Permalink
Don't replace a link if the result is a link
Browse files Browse the repository at this point in the history
  • Loading branch information
toutpt committed Aug 14, 2013
1 parent fe813c5 commit 8191621
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
2.0a5 (unreleased)
------------------

- Nothing changed yet.
- Don't replace a link if the result is a link [toutpt]


2.0a4 (2013-05-17)
Expand Down
6 changes: 4 additions & 2 deletions collective/oembed/jquery.oembed.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@

/* Public functions */
$.fn.oembed.insertCode = function (container, embedMethod, oembedData) {
var html = $(oembedData.code);
if (oembedData === null)
return;

switch (embedMethod) {
case "auto":
if (container.attr("href") !== null) {
Expand All @@ -266,8 +266,10 @@
}
break;
case "replace":
if (html.is("a")){
break;
}
if (container.hasClass("oembed-responsive")){
var html = $(oembedData.code);
if (html.is("iframe") || html.is("object") || html.is("embed")){
var width = parseInt(html.attr("width"), null), height = parseInt(html.attr("height"), null);
var ratio = height / width;
Expand Down

0 comments on commit 8191621

Please sign in to comment.