Skip to content

Commit 9fa9a34

Browse files
committed
resolved #249: register to windows resize event properly
1 parent dcbb214 commit 9fa9a34

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

angular/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<top-bar></top-bar>
44

5-
<section>
5+
<section (window:resize)="onResize($event)">
66
<aside id="leftsidebar" class="sidebar">
77
<sidebar-user-area></sidebar-user-area>
88
<sidebar-nav></sidebar-nav>

angular/src/app/app.component.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, ViewContainerRef, Injector, OnInit, AfterViewInit } from '@angular/core';
1+
import { Component, ViewContainerRef, Injector, OnInit, AfterViewInit, ChangeDetectorRef } from '@angular/core';
22
import { AppComponentBase } from '@shared/app-component-base';
33

44
import { SignalRAspNetCoreHelper } from '@shared/helpers/SignalRAspNetCoreHelper';
@@ -17,6 +17,7 @@ export class AppComponent extends AppComponentBase implements OnInit, AfterViewI
1717
}
1818

1919
ngOnInit(): void {
20+
2021
SignalRAspNetCoreHelper.initSignalR();
2122

2223
abp.event.on('abp.notifications.received', userNotification => {
@@ -36,7 +37,17 @@ export class AppComponent extends AppComponentBase implements OnInit, AfterViewI
3637
}
3738

3839
ngAfterViewInit(): void {
39-
($ as any).AdminBSB.activateAll();
40-
($ as any).AdminBSB.activateDemo();
40+
$.AdminBSB.activateAll();
41+
$.AdminBSB.activateDemo();
42+
}
43+
44+
onResize(event) {
45+
// exported from $.AdminBSB.activateAll
46+
$.AdminBSB.leftSideBar.setMenuHeight();
47+
$.AdminBSB.leftSideBar.checkStatuForResize(false);
48+
49+
// exported from $.AdminBSB.activateDemo
50+
$.AdminBSB.demo.setSkinListHeightAndScroll();
51+
$.AdminBSB.demo.setSettingListHeightAndScroll();
4152
}
4253
}

angular/src/bsb-theme/js/admin.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@
9999
//Set menu height
100100
_this.setMenuHeight();
101101
_this.checkStatuForResize(true);
102-
$(window).resize(function () {
103-
_this.setMenuHeight();
104-
_this.checkStatuForResize(false);
105-
});
102+
//$(window).resize(function () {
103+
// _this.setMenuHeight();
104+
// _this.checkStatuForResize(false);
105+
//});
106106

107107
//Set Waves
108108
Waves.attach('.menu .list a', ['waves-block']);
@@ -463,4 +463,5 @@
463463
$.AdminBSB.select.activate();
464464
$.AdminBSB.search.activate();
465465
}
466-
})();
466+
467+
})();

angular/src/bsb-theme/js/demo.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
$.AdminBSB.activateDemo = function() {
2-
activateNotificationAndTasksScroll();
1+
$.AdminBSB.activateDemo = function () {
2+
activateNotificationAndTasksScroll();
33

4-
setSkinListHeightAndScroll();
5-
setSettingListHeightAndScroll();
6-
$(window).resize(function() {
74
setSkinListHeightAndScroll();
85
setSettingListHeightAndScroll();
9-
});
6+
//$(window).resize(function () {
7+
// setSkinListHeightAndScroll();
8+
// setSettingListHeightAndScroll();
9+
//});
1010
};
1111

1212
//Skin tab content set height and show scroll
@@ -55,4 +55,8 @@ function activateNotificationAndTasksScroll() {
5555
borderRadius: '0',
5656
railBorderRadius: '0'
5757
});
58-
}
58+
}
59+
60+
$.AdminBSB.demo = $.AdminBSB.demo || {};
61+
$.AdminBSB.demo.setSkinListHeightAndScroll = setSkinListHeightAndScroll;
62+
$.AdminBSB.demo.setSettingListHeightAndScroll = setSettingListHeightAndScroll;

0 commit comments

Comments
 (0)