Use a wrapper on toolbar to keep the space when toolbar is fixed

Without such fix, the size of the scrollbar can change and thus prevents to
scroll up to a record.
This commit is contained in:
C?dric Krier 2015-10-23 12:21:12 +02:00
parent c66fd48be5
commit 4d54c0f2ce

View file

@ -85,6 +85,9 @@
'</div>' +
'</nav>'
);
var wrapper = jQuery('<div/>', {
'class': 'nav-wrapper'
}).append(toolbar);
this.set_menu(toolbar.find('ul[role*="menu"]'));
var add_button = function(tool) {
@ -121,6 +124,13 @@
}
}
});
toolbar.on('affix.bs.affix', function() {
wrapper.height(toolbar.height());
});
toolbar.on('affix-top.bs.affix affix-bottom.bs.affix',
function() {
wrapper.height('');
});
toolbar.on('affixed.bs.affix', function() {
Sao.Tab.affix_set_with(toolbar);
});
@ -128,7 +138,7 @@
function() {
Sao.Tab.affix_unset_width(toolbar);
});
return toolbar;
return wrapper;
},
close: function() {
var tabs = jQuery('#tabs');