fix drop from two touches to one
This commit is contained in:
parent
ba943b20f1
commit
ddbaac513f
2 changed files with 25 additions and 4 deletions
18
app/services/activity_service.rb
Normal file
18
app/services/activity_service.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
class ActivityService
|
||||
|
||||
def self.send_activity_for_followers(map, reason_filter = nil)
|
||||
follows = FollowService.get_follows_for_entity(map, nil, reason_filter)
|
||||
|
||||
# generate the full set of activity here
|
||||
|
||||
follows.each{|follow|
|
||||
# check here whether this person needs to receive anything
|
||||
# related to the activity that occurred on the map
|
||||
|
||||
body = NotificationService.renderer.render(template: 'template', locals: {}, layout: false)
|
||||
follow.user.notify('subject', body, event, false, MAP_ACTIVITY, follow.user.emails_allowed, ??)
|
||||
}
|
||||
end
|
||||
|
||||
end
|
|
@ -2692,28 +2692,31 @@ Extras.Classes.Navigation = new Class({
|
|||
y: (e.touches[0].clientY + e.touches[1].clientY) / 2
|
||||
}
|
||||
if (30 >= desiredScale && desiredScale >= 0.2) {
|
||||
//canvas.scale(scaler, scaler)
|
||||
Metamaps.Util.zoomOnPoint(this, scaler, midpoint)
|
||||
jQuery(document).trigger(Metamaps.JIT.events.zoom)
|
||||
}
|
||||
jQuery(document).trigger(Metamaps.JIT.events.zoom);
|
||||
}
|
||||
},
|
||||
|
||||
onTouchEnd: function(e, win, eventInfo, isRightClick) {
|
||||
if(!this.config.panning) return;
|
||||
this.pressed = false;
|
||||
if (e.touches.length === 1) {
|
||||
var canvas = this.canvas,
|
||||
ox = canvas.translateOffsetX,
|
||||
oy = canvas.translateOffsetY,
|
||||
sx = canvas.scaleOffsetX,
|
||||
sy = canvas.scaleOffsetY
|
||||
sy = canvas.scaleOffsetY,
|
||||
s = canvas.getSize();
|
||||
this.pos = {
|
||||
x: (e.touches[0].clientX - s.width/2 - ox) * 1/sx,
|
||||
y: (e.touches[0].clientY - s.height/2 - oy) * 1/sy
|
||||
};
|
||||
this.pos.x *= sx;
|
||||
this.pos.x += ox;
|
||||
this.pos.y *= sy;
|
||||
this.pos.y += oy;
|
||||
} else if (e.touches.length === 0) {
|
||||
this.pressed = false;
|
||||
this.pos = null
|
||||
if (Metamaps.Mouse.didPan) Metamaps.JIT.SmoothPanning();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue