Skip to content

Commit

Permalink
don't fire click event if dropdown item is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ismcagdas committed Mar 29, 2017
1 parent e26cea1 commit 6b93b64
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/extensions/jquery.jtable.record-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@
$a.html(fieldItem.text);
}

if(fieldItem.action && (fieldItem.enabled && fieldItem.enabled({ record: record }))) {
$a.click(function(){
fieldItem.action({
record: record
});
});
if (fieldItem.action) {
$a.click(function (e) {
e.preventDefault();

if (!$(this).closest('li').hasClass('disabled')) {
fieldItem.action({
record: record
});
}
});
}

$a.appendTo($li);
Expand Down

0 comments on commit 6b93b64

Please sign in to comment.