#920 click event change to 'event, touchstart' for mobile popup_menu

This commit is contained in:
akasima 2014-08-23 15:06:51 +09:00
parent 39b306e8f8
commit ef50e140e5
3 changed files with 28 additions and 3 deletions

View file

@ -911,7 +911,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click touchstart', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -927,6 +927,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,

View file

@ -910,7 +910,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click touchstart', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -926,6 +926,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,

3
common/js/xe.min.js vendored

File diff suppressed because one or more lines are too long