1
0
Fork 0
forked from 0x2620/oxjs

add clickLink to video widgets

This commit is contained in:
j 2012-01-17 21:13:46 +05:30
commit f2d7beeb22
6 changed files with 23 additions and 4 deletions

View file

@ -43,11 +43,18 @@ Ox.Editable = function(options, self) {
.bindEvent({
doubleclick: edit,
singleclick: function(e) {
if ($(e.target).is('a')) {
var $target = $(e.target),
$parent = $target.parent();
while(!$target.is('a') && !$parent.is('.OxEditableElement')) {
$target = $parent;
$parent = $target.parent();
}
if($target.is('a')) {
if (self.options.clickLink) {
e.target = $target[0];
self.options.clickLink(e);
} else {
document.location.href = $(e.target).attr('href');
document.location.href = $target.attr('href');
}
}
}