fix all the pronto remarks finally
- fix map controls in stream
This commit is contained in:
parent
52fac5740e
commit
1cdcc50c63
8 changed files with 16 additions and 9 deletions
|
|
@ -30,7 +30,9 @@ app.views.LocationStream = app.views.Content.extend({
|
|||
|
||||
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
||||
id: gon.appConfig.map.mapbox.id,
|
||||
/* jshint camelcase: false */
|
||||
accessToken: gon.appConfig.map.mapbox.access_token,
|
||||
/* jshint camelcase: true */
|
||||
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
||||
|
|
@ -40,7 +42,7 @@ app.views.LocationStream = app.views.Content.extend({
|
|||
|
||||
tiles.addTo(map);
|
||||
|
||||
var markerOnMap = L.marker(location).addTo(map);
|
||||
L.marker(location).addTo(map);
|
||||
mapContainer.removeClass("empty");
|
||||
return map;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@ app.views.SinglePostContent = app.views.Base.extend({
|
|||
|
||||
tiles = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
|
||||
id: gon.appConfig.map.mapbox.id,
|
||||
/* jshint camelcase: false */
|
||||
accessToken: gon.appConfig.map.mapbox.access_token,
|
||||
/* jshint camelcase: true */
|
||||
attribution: "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors, " +
|
||||
"<a href='http://creativecommons.org/licenses/by-sa/2.0/''>CC-BY-SA</a>, " +
|
||||
"Imagery © <a href='https://www.mapbox.com'>Mapbox</a>",
|
||||
|
|
@ -68,7 +70,7 @@ app.views.SinglePostContent = app.views.Base.extend({
|
|||
map.invalidateSize();
|
||||
|
||||
// put marker on map
|
||||
var markerOnMap = L.marker(location).addTo(map);
|
||||
L.marker(location).addTo(map);
|
||||
return map;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@
|
|||
font-size: $font-size-small;
|
||||
color: $text-grey;
|
||||
}
|
||||
.leaflet-control-zoom {
|
||||
display: block;
|
||||
}
|
||||
.grey { color: $text-grey; }
|
||||
.post-content p:last-of-type { margin-bottom: 0; }
|
||||
.nsfw-shield {
|
||||
|
|
|
|||
|
|
@ -140,10 +140,9 @@ FactoryGirl.define do
|
|||
end
|
||||
|
||||
factory(:location) do
|
||||
address "Starco Mart, Mission Street, West SoMa, San Francisco, San Francisco "\
|
||||
"City and County, Kalifornien, 94103, Vereinigte Staaten von Amerika"
|
||||
lat 37.78
|
||||
lng -122.41
|
||||
address "Fernsehturm Berlin, Berlin, Germany"
|
||||
lat 52.520645
|
||||
lng 13.409779
|
||||
end
|
||||
|
||||
factory(:poll) do
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ describe("app.views.LocationStream", function() {
|
|||
beforeEach(function(){
|
||||
this.post = factory.post();
|
||||
this.view = new app.views.LocationStream({model : this.post});
|
||||
/* jshint camelcase: false */
|
||||
gon.appConfig = {map: { mapbox: {enabled: true, id: "yourID", access_token: "yourAccessToken" }}};
|
||||
/* jshint camelcase: true */
|
||||
});
|
||||
|
||||
describe("toggleMap", function() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
describe("app.views.Location", function(){
|
||||
beforeEach(function(){
|
||||
OSM = {};
|
||||
OSM.Locator = function(){return { getAddress:function(){}}};
|
||||
|
||||
this.view = new app.views.Location();
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ var factory = {
|
|||
|
||||
location : function() {
|
||||
return {
|
||||
address: "Starco Mart, Mission Street, West SoMa, San Francisco, San Francisco City and County, Kalifornien, 94103, Vereinigte Staaten von Amerika",
|
||||
address: "Starco Mart, Mission Street, San Francisco, Kalifornien, 94103, Vereinigte Staaten von Amerika",
|
||||
lat: 37.78,
|
||||
lng: -122.41
|
||||
};
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ describe StatusMessage, type: :model do
|
|||
describe ".guids_for_author" do
|
||||
it "returns an array of the status_message guids" do
|
||||
status_message_1 = FactoryGirl.create(:status_message, author: alice.person)
|
||||
status_message_2 = FactoryGirl.create(:status_message, author: bob.person)
|
||||
FactoryGirl.create(:status_message, author: bob.person)
|
||||
guids = StatusMessage.guids_for_author(alice.person)
|
||||
expect(guids).to eq([status_message_1.guid])
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue