Created
June 17, 2014 12:14
-
-
Save jarosan/5b5eba5f1719252d9ae3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initArticleImages: -> | |
@element.find(".article__body img").each -> | |
self = $(@) | |
if alt = self.attr("alt") | |
wrapper_div = $('<div></div>').addClass(self.attr("class")) | |
self.attr("class", "") | |
wrapper_div.appendTo(self.parent("p")) | |
self.detach().appendTo(wrapper_div) | |
$("<span class='article__body__image-subtitle'></span>").text(alt).appendTo(wrapper_div) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
как-то так наверное