Fixed invalid window.scroll calls.

Resolved ticket #882298 (https://bugzilla.mozilla.org/show_bug.cgi?id=882298).
This commit is contained in:
Hike Danakian 2013-06-12 14:46:43 -07:00
Родитель 86dae1c061
Коммит ed8e284346
3 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -23,7 +23,7 @@ function ($, UI, MapMaker) {
showDuration: true
});
setTimeout(scroll, 100);
setTimeout(scroll.bind(window, 0, 0), 100);
return {
setupImageUpload: function ($form) {

Просмотреть файл

@ -1,5 +1,6 @@
define(['jquery', 'model', 'forms', 'bootstrap-markdown', 'domReady!'],
function ($, EventModel, forms) { return function (mapMaker) {
var $findForm = $('form#find-event');
$findForm.find('button[type="submit"]').click(function (ev) {
ev.preventDefault();
@ -69,7 +70,7 @@ function ($, EventModel, forms) { return function (mapMaker) {
$.post($createForm.attr('action'), data, function (data) {
if (data.event) {
toggleCreateForm();
scroll();
scroll(0, 0);
var evt = new EventModel(data.event);
$where.val('');
mapMaker.google_map.setCenter(
@ -108,10 +109,12 @@ function ($, EventModel, forms) { return function (mapMaker) {
});
mapMaker.setupAutocomplete($createForm.find('input[name="address"]')[0], false, function (place) {
var loc = { latitude: place.geometry.location.lat(),
longitude: place.geometry.location.lng() };
for (var k in loc)
$createForm.find('input[name="'+k+'"]').val(loc[k]);
if (place && place.geometry) {
var loc = { latitude: place.geometry.location.lat(),
longitude: place.geometry.location.lng() };
for (var k in loc)
$createForm.find('input[name="'+k+'"]').val(loc[k]);
}
});
forms.setupImageUpload($createForm);

Просмотреть файл

@ -71,7 +71,7 @@ function ($, google, InfoBubble, OverlappingMarkerSpiderfier, MarkerClusterer) {
this.markerManager.addMarker(marker);
this.oms.addMarker(marker); // must keep oms in sync
scroll();
scroll(0, 0);
// store the content for the info window in the marker
marker.set('infoContent', model.popupHTML());