Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Simplify wrapping logic, fix context.
  • Loading branch information
dannon committed Sep 25, 2018
1 parent 7c290b1 commit 34d5455
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/galaxy/scripts/ui/fa-icon-button.js
@@ -1,6 +1,5 @@
import jQuery from "jquery";
import * as _ from "underscore";
("use_strict");

var $ = jQuery;
//============================================================================
Expand Down Expand Up @@ -43,12 +42,11 @@ var faIconButton = options => {
].join("");
var $button = $(html).tooltip(options.tooltipConfig);
if (_.isFunction(options.onclick)) {
let wrapped = _.wrap(options.onclick, function(func) {
$button.click(function(ev){
$button.tooltip("hide");
$button.parent().attr('tabindex', -1).focus();
func.apply(this, arguments);
options.onclick.apply(this, arguments);
});
$button.click(wrapped);
}
return $button;
};
Expand Down

0 comments on commit 34d5455

Please sign in to comment.