This is the extended method 'cloneFrom' for timespinner component.
(function($){
$.extend($.fn.spinner.methods, {
cloneFrom: function(jq, from){
return jq.each(function(){
$(this).textbox('cloneFrom', from);
$.data(this, 'spinner', {
options: $.extend(true, {clone:true}, $(from).spinner('options'))
});
$(this).addClass('spinner-f').attr('spinnerName', $(this).attr('textboxName'));
});
}
});
$.extend($.fn.timespinner.methods, {
cloneFrom: function(jq, from){
return jq.each(function(){
$(this).spinner('cloneFrom', from);
$.data(this, 'timespinner', {
options: $.extend(true, {clone:true}, $(from).timespinner('options'))
});
$(this).addClass('timespinner-f').attr('timespinnerName', $(this).attr('spinnerName'));
});
}
});
})(jQuery);
Usage example:
$('#t1').timespinner('cloneFrom', '#t')