forked from 0x2620/oxjs
add clickLink to video widgets
This commit is contained in:
parent
41e191f217
commit
f2d7beeb22
6 changed files with 23 additions and 4 deletions
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue