mirror of
https://github.com/NaN-tic/sao-base.git
synced 2023-12-14 03:13:01 +01:00
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:
parent
c66fd48be5
commit
4d54c0f2ce
1 changed files with 11 additions and 1 deletions
12
src/tab.js
12
src/tab.js
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue