Merge pull request #1832 from scottbedard/patch-2

Add ctrl+click support for rowlinks
This commit is contained in:
Samuel Georges 2016-03-12 10:58:11 +11:00
commit 076f5199af
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
* Table row linking plugin
*
*
* Data attributes:
* - data-control="rowlink" - enables the plugin on an element
*
@ -36,9 +36,11 @@
var href = link.attr('href'),
onclick = (typeof link.get(0).onclick == "function") ? link.get(0).onclick : null
$(this).find('td').not('.' + options.excludeClass).click(function() {
$(this).find('td').not('.' + options.excludeClass).click(function(e) {
if (onclick)
onclick.apply(link.get(0))
else if (e.ctrlKey)
window.open(href);
else
window.location = href;
})
@ -88,4 +90,4 @@
$('[data-control="rowlink"]').rowLink()
})
}(window.jQuery);
}(window.jQuery);