Skip to content

Commit

Permalink
Merge branch 'pr/45-fixed-bug-right-sidebar-slimscroll-when-start'
Browse files Browse the repository at this point in the history
  • Loading branch information
Güray Yarar committed Jun 21, 2017
2 parents 699a2e8 + c1da2f7 commit 94652c5
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ $(function () {
skinChanger();
activateNotificationAndTasksScroll();

setSkinListHeightAndScroll();
setSettingListHeightAndScroll();
setSkinListHeightAndScroll(true);
setSettingListHeightAndScroll(true);
$(window).resize(function () {
setSkinListHeightAndScroll();
setSettingListHeightAndScroll();
setSkinListHeightAndScroll(false);
setSettingListHeightAndScroll(false);
});
});

Expand All @@ -26,35 +26,39 @@ function skinChanger() {
}

//Skin tab content set height and show scroll
function setSkinListHeightAndScroll() {
function setSkinListHeightAndScroll(isFirstTime) {
var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());
var $el = $('.demo-choose-skin');

$el.slimScroll({ destroy: true }).height('auto');
$el.parent().find('.slimScrollBar, .slimScrollRail').remove();
if (!isFirstTime){
$el.slimScroll({ destroy: true }).height('auto');
$el.parent().find('.slimScrollBar, .slimScrollRail').remove();
}

$el.slimscroll({
height: height + 'px',
color: 'rgba(0,0,0,0.5)',
size: '4px',
size: '6px',
alwaysVisible: false,
borderRadius: '0',
railBorderRadius: '0'
});
}

//Setting tab content set height and show scroll
function setSettingListHeightAndScroll() {
function setSettingListHeightAndScroll(isFirstTime) {
var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());
var $el = $('.right-sidebar .demo-settings');

$el.slimScroll({ destroy: true }).height('auto');
$el.parent().find('.slimScrollBar, .slimScrollRail').remove();
if (!isFirstTime){
$el.slimScroll({ destroy: true }).height('auto');
$el.parent().find('.slimScrollBar, .slimScrollRail').remove();
}

$el.slimscroll({
height: height + 'px',
color: 'rgba(0,0,0,0.5)',
size: '4px',
size: '6px',
alwaysVisible: false,
borderRadius: '0',
railBorderRadius: '0'
Expand Down Expand Up @@ -100,4 +104,4 @@ function loadTracking() {
ga('create', trackingId, 'auto');
ga('send', 'pageview');
}
//========================================================================================================
//========================================================================================================

0 comments on commit 94652c5

Please sign in to comment.