actually clear photos from the publisher. also, i hate the photo uploader we're using.
This commit is contained in:
parent
91e3f5f6ff
commit
9d2b1e9415
2 changed files with 10 additions and 0 deletions
|
|
@ -48,6 +48,7 @@ app.views.Publisher = Backbone.View.extend({
|
||||||
|
|
||||||
// remove photos
|
// remove photos
|
||||||
this.$("#photodropzone").find('li').remove();
|
this.$("#photodropzone").find('li').remove();
|
||||||
|
this.$("input[name='photos[]']").remove();
|
||||||
|
|
||||||
// close publishing area (CSS)
|
// close publishing area (CSS)
|
||||||
this.close();
|
this.close();
|
||||||
|
|
|
||||||
|
|
@ -56,5 +56,14 @@ describe("app.views.Publisher", function() {
|
||||||
this.view.clear($.Event());
|
this.view.clear($.Event());
|
||||||
expect(this.view.$("#photodropzone").html()).toBe("");
|
expect(this.view.$("#photodropzone").html()).toBe("");
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("removes all photo values appended by the photo uploader", function(){
|
||||||
|
$(this.view.el).prepend("<input name='photos[]' value='3'/>")
|
||||||
|
var photoValuesInput = this.view.$("input[name='photos[]']");
|
||||||
|
|
||||||
|
photoValuesInput.val("3")
|
||||||
|
this.view.clear($.Event());
|
||||||
|
expect(this.view.$("input[name='photos[]']").length).toBe(0);
|
||||||
|
})
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue