From ddbaac513ff43e1459c02f58e6e281840a597ef7 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Thu, 2 Mar 2017 04:35:13 +0000 Subject: [PATCH] fix drop from two touches to one --- app/services/activity_service.rb | 18 ++++++++++++++++++ frontend/src/patched/JIT.js | 11 +++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 app/services/activity_service.rb diff --git a/app/services/activity_service.rb b/app/services/activity_service.rb new file mode 100644 index 00000000..9d3009ff --- /dev/null +++ b/app/services/activity_service.rb @@ -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 \ No newline at end of file diff --git a/frontend/src/patched/JIT.js b/frontend/src/patched/JIT.js index 10af6123..5ea04ce1 100644 --- a/frontend/src/patched/JIT.js +++ b/frontend/src/patched/JIT.js @@ -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(); }