Browse Source

Fixed crash on chrome app link middle-click

Closes #1471
master
Igor Zhukov 7 years ago
parent
commit
52cbc56906
  1. 18
      app/js/services.js

18
app/js/services.js

@ -4737,11 +4737,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -4737,11 +4737,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
!target.onclick &&
!target.onmousedown) {
var href = $(target).attr('href') || target.href || ''
if (Config.Modes.chrome_packed &&
href.length &&
$(target).attr('target') == '_blank') {
$(target).attr('rel', '')
}
var match = href.match(tgAddrRegExp)
if (match) {
if (handleTgProtoAddr(match[3], true)) {
@ -4751,6 +4746,19 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) @@ -4751,6 +4746,19 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
}
})
$(document).on('mousedown', function (event) {
var target = event.target
if (target &&
target.tagName == 'A') {
var href = $(target).attr('href') || target.href || ''
if (Config.Modes.chrome_packed &&
href.length &&
$(target).attr('target') == '_blank') {
$(target).attr('rel', '')
}
}
})
$rootScope.$on('$routeUpdate', checkLocationTgAddr)
checkLocationTgAddr()
}

Loading…
Cancel
Save