mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
Fix bad commit (adding files)
This commit is contained in:
@@ -1,48 +1,2 @@
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], factory);
|
||||
} else {
|
||||
root.faIconButton = factory();
|
||||
}
|
||||
|
||||
}(this, function () {
|
||||
//============================================================================
|
||||
/** Returns a jQuery object containing a clickable font-awesome button.
|
||||
* options:
|
||||
* tooltipConfig : option map for bootstrap tool tip
|
||||
* classes : array of class names (will always be classed as icon-btn)
|
||||
* disabled : T/F - add the 'disabled' class?
|
||||
* title : tooltip/title string
|
||||
* target : optional href target
|
||||
* href : optional href
|
||||
* faIcon : which font awesome icon to use
|
||||
* onclick : function to call when the button is clicked
|
||||
*/
|
||||
var faIconButton = function( options ){
|
||||
options = options || {};
|
||||
options.tooltipConfig = options.tooltipConfig || { placement: 'bottom' };
|
||||
|
||||
options.classes = [ 'icon-btn' ].concat( options.classes || [] );
|
||||
if( options.disabled ){
|
||||
options.classes.push( 'disabled' );
|
||||
}
|
||||
|
||||
var html = [
|
||||
'<a class="', options.classes.join( ' ' ), '"',
|
||||
(( options.title )?( ' title="' + options.title + '"' ):( '' )),
|
||||
(( !options.disabled && options.target )? ( ' target="' + options.target + '"' ):( '' )),
|
||||
' href="', (( !options.disabled && options.href )?( options.href ):( 'javascript:void(0);' )), '">',
|
||||
// could go with something less specific here - like 'html'
|
||||
'<span class="fa ', options.faIcon, '"></span>',
|
||||
'</a>'
|
||||
].join( '' );
|
||||
var $button = $( html ).tooltip( options.tooltipConfig );
|
||||
if( _.isFunction( options.onclick ) ){
|
||||
$button.click( options.onclick );
|
||||
}
|
||||
return $button;
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
return faIconButton;
|
||||
}));
|
||||
!function(a,b){"function"==typeof define&&define.amd?define([],b):a.faIconButton=b()}(this,function(){var a=function(a){a=a||{},a.tooltipConfig=a.tooltipConfig||{placement:"bottom"},a.classes=["icon-btn"].concat(a.classes||[]),a.disabled&&a.classes.push("disabled");var b=['<a class="',a.classes.join(" "),'"',a.title?' title="'+a.title+'"':"",!a.disabled&&a.target?' target="'+a.target+'"':"",' href="',!a.disabled&&a.href?a.href:"javascript:void(0);",'">','<span class="fa ',a.faIcon,'"></span>',"</a>"].join(""),c=$(b).tooltip(a.tooltipConfig);return _.isFunction(a.onclick)&&c.click(a.onclick),c};return a});
|
||||
//# sourceMappingURL=../../maps/ui/fa-icon-button.js.map
|
||||
Reference in New Issue
Block a user