remove stray console.logs, set $.fx.off to true to make the failing likes spec pass in firefox
This commit is contained in:
parent
f788de17fd
commit
7e20cece42
3 changed files with 15 additions and 12 deletions
|
|
@ -25,8 +25,6 @@
|
|||
? self.services[service]
|
||||
: self.services.undefined;
|
||||
|
||||
console.log(template);
|
||||
console.log(views);
|
||||
return $.mustache(template, views);
|
||||
};
|
||||
|
||||
|
|
@ -50,10 +48,8 @@
|
|||
$("div.video-container").slideUp("fast", function() { $(this).detach(); });
|
||||
}
|
||||
|
||||
console.log(videoLink.data());
|
||||
container.html(
|
||||
self.render(host, videoLink.data())
|
||||
|
||||
);
|
||||
|
||||
container.hide()
|
||||
|
|
|
|||
|
|
@ -2,10 +2,12 @@
|
|||
var Likes = function() {
|
||||
var self = this;
|
||||
|
||||
this.subscribe("widget/ready", function(evt, element) {
|
||||
this.subscribe("widget/ready", function(evt, likesContainer) {
|
||||
$.extend(self, {
|
||||
likesContainer: likesContainer,
|
||||
likesList: likesContainer.find(".likes_list"),
|
||||
loadingImage: $("<img/>", { src: "/images/ajax-loader.gif" }),
|
||||
expander: element.find("a.expand_likes")
|
||||
expander: likesContainer.find("a.expand_likes")
|
||||
});
|
||||
|
||||
self.expander.click(self.expandLikes);
|
||||
|
|
@ -14,18 +16,18 @@
|
|||
this.expandLikes = function(evt) {
|
||||
evt.preventDefault();
|
||||
|
||||
var likesList = self.expander.siblings(".likes_list");
|
||||
if(likesList.children().length == 0) {
|
||||
self.loadingImage.appendTo(likesList.parent());
|
||||
if(self.likesList.children().length == 0) {
|
||||
self.loadingImage.appendTo(self.likesContainer);
|
||||
|
||||
$.get(self.expander.attr('href'), function(data) {
|
||||
self.loadingImage.fadeOut(100, function() {
|
||||
likesList.html(data)
|
||||
self.likesList.html(data)
|
||||
.fadeToggle(100);
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
likesList.fadeToggle(100);
|
||||
self.likesList.fadeToggle(100);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ describe("Diaspora.Widgets.Likes", function() {
|
|||
beforeEach(function() {
|
||||
spec.loadFixture("aspects_index_with_a_post_with_likes");
|
||||
likes = Diaspora.BaseWidget.instantiate("Likes", $(".stream_element .likes_container"));
|
||||
$.fx.off = true;
|
||||
});
|
||||
|
||||
describe("integration", function() {
|
||||
|
|
@ -50,4 +51,8 @@ describe("Diaspora.Widgets.Likes", function() {
|
|||
expect($(".stream_element .likes_list").html()).toEqual("some html response");
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
$.fx.off = false;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue