Fix click handler on links does not stop propagation, causes unwanted click event

This commit is contained in:
Hadi Nategh 2015-03-31 10:01:51 +00:00
parent 92ee011a45
commit ed2bed1b97
2 changed files with 10 additions and 2 deletions

View File

@ -1147,8 +1147,9 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM],
if(_value.id && _value.app)
{
this.link.addClass("et2_link");
this.link.click( function(){
this.link.click( function(e){
self.egw().open(_value, "", "view",null,_value.app,_value.app);
e.stopImmediatePropagation();
});
}
else
@ -1344,7 +1345,10 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM],
var link = $j(document.createElement("li"))
.appendTo(this.list)
.addClass("et2_link loading")
.click( function(){self.egw().open(_link_data, "", "view",null,_link_data.app,_link_data.app);});
.click( function(e){
self.egw().open(_link_data, "", "view",null,_link_data.app,_link_data.app);
e.stopImmediatePropagation();
});
if(_link_data.title) link.text(_link_data.title);

View File

@ -134,6 +134,10 @@ function egwPopupActionImplementation()
ai._registerDefault = function(_node, _callback, _context)
{
var defaultHandler = function(e) {
// Prevent bubbling bound event on <a> tag, on touch devices
// a tag should be handled by default event
if (egwIsMobile && e.target.tagName == "A") return true;
if (typeof document.selection != "undefined" && typeof document.selection.empty != "undefined")
{
document.selection.empty();