Fix: remove location when publisher is cleared by user

This commit is contained in:
Damien Monet 2014-01-05 11:09:03 +01:00
parent 9be0b075ac
commit b849d6c641
3 changed files with 13 additions and 3 deletions

View file

@ -63,6 +63,7 @@ For more details see https://wiki.diasporafoundation.org/Updating
* Fix posting to Twitter by correctly catching exception [#4627](https://github.com/diaspora/diaspora/issues/4627)
* Change "Show n more comments"-link, fix [#3119](https://github.com/diaspora/diaspora/issues/3119)
* Specify Firefox version for Travis-CI [#4623](https://github.com/diaspora/diaspora/pull/4623)
* Remove location when publisher is cleared by user
## Features
* Add oEmbed content to the mobile view [#4343](https://github.com/diaspora/diaspora/pull/4353)

View file

@ -141,9 +141,6 @@ app.views.Publisher = Backbone.View.extend({
// clear state
this.clear();
// clear location
this.destroyLocation();
},
// creates the location
@ -283,6 +280,9 @@ app.views.Publisher = Backbone.View.extend({
// disable submitting
this.checkSubmitAvailability();
// clear location
this.destroyLocation();
// force textchange plugin to update lastValue
this.el_input.data('lastValue', '');
this.el_hiddenInput.data('lastValue', '');

View file

@ -105,6 +105,15 @@ describe("app.views.Publisher", function() {
this.view.clear($.Event());
expect(this.view.$("input[name='photos[]']").length).toBe(0);
})
it("destroy location if exists", function(){
setFixtures('<div id="location"></div>');
this.view.view_locator = new app.views.Location({el: "#location"});
expect($("#location").length).toBe(1);
this.view.clear($.Event());
expect($("#location").length).toBe(0);
})
});
describe("createStatusMessage", function(){