top scrollbar on poll table

This commit is contained in:
jelhan 2014-10-25 02:04:11 +02:00
parent fe4e6cd275
commit 50a2866b26

View file

@ -16,6 +16,28 @@ export default Ember.View.extend(Em.I18n.TranslateableProperties, {
this._super(); this._super();
Ember.run.scheduleOnce('afterRender', this, function(){ Ember.run.scheduleOnce('afterRender', this, function(){
$('.user-selections-table').floatThead({}); $('.user-selections-table').floatThead({});
/*
* scrollbar on top of table
*/
var topScrollbarInner = $('<div></div>')
.css('width', $('.user-selections-table').width() )
.css('height', '1px');
var topScrollbarOuter = $('<div></div>')
.addClass('top-scrollbar')
.css('width', '100%' )
.css('overflow-x', 'scroll')
.css('overflow-y', 'hidden');
$('.table-scroll').before(
topScrollbarOuter.append(topScrollbarInner)
);
$('.table-scroll').scroll(function(){
$('.top-scrollbar').scrollLeft( $('.table-scroll').scrollLeft() );
});
$('.top-scrollbar').scroll(function(){
$('.table-scroll').scrollLeft( $('.top-scrollbar').scrollLeft() );
});
}); });
}, },