prevent popup blocker for external links

This commit is contained in:
j 2013-02-01 14:07:20 +00:00
parent c9d089ce5f
commit 7bb9afa4ed

View file

@ -64,15 +64,10 @@ Ox.Editable = function(options, self) {
}) })
.addClass('OxEditableElement' + (self.options.editable ? ' OxEditable' : '')) .addClass('OxEditableElement' + (self.options.editable ? ' OxEditable' : ''))
.on({ .on({
click: function() { click: function(e) {
return false;
}
})
.bindEvent({
doubleclick: edit,
singleclick: function(e) {
var $target = $(e.target); var $target = $(e.target);
if ($target.is('a') || ($target = $target.parents('a')).length) { if ($target.is('a') || ($target = $target.parents('a')).length) {
e.preventDefault();
if (self.options.clickLink) { if (self.options.clickLink) {
e.target = $target[0]; e.target = $target[0];
self.options.clickLink(e); self.options.clickLink(e);
@ -80,6 +75,12 @@ Ox.Editable = function(options, self) {
document.location.href = $target.attr('href'); document.location.href = $target.attr('href');
} }
} }
return false;
}
})
.bindEvent({
doubleclick: edit,
singleclick: function(e) {
} }
}); });