Repository: wicket Updated Branches: refs/heads/wicket-6.x 018b78f58 -> 0fcdbf4f8
WICKET-6204 Copy only the available link attributes in Ajax response Fixes #173 Project: http://git-wip-us.apache.org/repos/asf/wicket/repo Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/0fcdbf4f Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/0fcdbf4f Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/0fcdbf4f Branch: refs/heads/wicket-6.x Commit: 0fcdbf4f8bb4fe5dc78eac9876db609c11114c85 Parents: 018b78f Author: Martin Tzvetanov Grigorov <[email protected]> Authored: Sun Jul 17 08:37:38 2016 +0200 Committer: Martin Tzvetanov Grigorov <[email protected]> Committed: Sun Jul 17 08:47:27 2016 +0200 ---------------------------------------------------------------------- .../apache/wicket/ajax/res/js/wicket-ajax-jquery.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/wicket/blob/0fcdbf4f/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js ---------------------------------------------------------------------- diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js index 7ae1bfd..a4f623d 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js +++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js @@ -2151,17 +2151,18 @@ // create link element var css = Wicket.Head.createElement("link"); - // copy required attributes - css.id = node.getAttribute("id"); - css.rel = node.getAttribute("rel"); - css.href = node.getAttribute("href"); - css.type = node.getAttribute("type"); + // copy supplied attributes only. + var attributes = $(node).prop("attributes"); + var $css = $(css); + $.each(attributes, function() { + $css.attr(this.name, this.value); + }); // add element to head Wicket.Head.addElement(css); // cross browser way to check when the css is loaded - // taked from http://www.backalleycoder.com/2011/03/20/link-tag-css-stylesheet-load-event/ + // taken from http://www.backalleycoder.com/2011/03/20/link-tag-css-stylesheet-load-event/ // this makes a second GET request to the css but it gets it either from the cache or // downloads just the first several bytes and realizes that the MIME is wrong and ignores the rest var img = document.createElement('img');
