Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileManager for Knockout - ViewModel binding doesn't work (T861302) #12833

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions js/ui/file_manager/ui.file_manager.adaptivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SplitterControl from '../splitter';
const window = getWindow();
const ADAPTIVE_STATE_SCREEN_WIDTH = 573;

const FILE_MANAGER_ADAPTIVITY_DRAWER_PANEL_CLASS = 'dx-filemanager-adaptivity-drawer-panel';
const DRAWER_PANEL_CONTENT_INITIAL = 'dx-drawer-panel-content-initial';

class FileManagerAdaptivityControl extends Widget {
Expand All @@ -23,17 +24,23 @@ class FileManagerAdaptivityControl extends Widget {

const $drawer = $('<div>').appendTo(this.$element());

const contentRenderer = this.option('contentTemplate');
if(isFunction(contentRenderer)) {
contentRenderer($drawer);
}
$('<div>')
.addClass(FILE_MANAGER_ADAPTIVITY_DRAWER_PANEL_CLASS)
.appendTo($drawer);

this._drawer = this._createComponent($drawer, Drawer);
this._drawer.option({
opened: true,
template: this._createDrawerTemplate.bind(this)
});
$(this._drawer.content()).addClass(DRAWER_PANEL_CONTENT_INITIAL);

const $drawerContent = $drawer.find(`.${FILE_MANAGER_ADAPTIVITY_DRAWER_PANEL_CLASS}`).first();

const contentRenderer = this.option('contentTemplate');
if(isFunction(contentRenderer)) {
contentRenderer($drawerContent);
}
}

_createDrawerTemplate(container) {
Expand Down
15 changes: 11 additions & 4 deletions js/ui/file_manager/ui.file_manager.notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ADAPTIVE_STATE_SCREEN_WIDTH = 1000;

const FILE_MANAGER_NOTIFICATION_CLASS = 'dx-filemanager-notification';
const FILE_MANAGER_NOTIFICATION_DRAWER_CLASS = `${FILE_MANAGER_NOTIFICATION_CLASS}-drawer`;
const FILE_MANAGER_NOTIFICATION_DRAWER_PANEL_CLASS = `${FILE_MANAGER_NOTIFICATION_DRAWER_CLASS}-panel`;
const FILE_MANAGER_NOTIFICATION_POPUP_CLASS = `${FILE_MANAGER_NOTIFICATION_CLASS}-popup`;
const FILE_MANAGER_NOTIFICATION_POPUP_ERROR_CLASS = `${FILE_MANAGER_NOTIFICATION_CLASS}-popup-error`;
const FILE_MANAGER_NOTIFICATION_COMMON_CLASS = `${FILE_MANAGER_NOTIFICATION_CLASS}-common`;
Expand All @@ -39,10 +40,9 @@ export default class FileManagerNotificationControl extends Widget {
.addClass(FILE_MANAGER_NOTIFICATION_DRAWER_CLASS)
.appendTo($progressPanelContainer);

const contentRenderer = this.option('contentTemplate');
if(isFunction(contentRenderer)) {
contentRenderer($progressDrawer);
}
$('<div>')
.addClass(FILE_MANAGER_NOTIFICATION_DRAWER_PANEL_CLASS)
.appendTo($progressDrawer);

const drawerOptions = extend({
opened: false,
Expand All @@ -52,6 +52,13 @@ export default class FileManagerNotificationControl extends Widget {
this._getProgressDrawerAdaptiveOptions());

this._progressDrawer = this._createComponent($progressDrawer, Drawer, drawerOptions);

const $drawerContent = $progressDrawer.find(`.${FILE_MANAGER_NOTIFICATION_DRAWER_PANEL_CLASS}`).first();

const contentRenderer = this.option('contentTemplate');
if(isFunction(contentRenderer)) {
contentRenderer($drawerContent);
}
}

tryShowProgressPanel() {
Expand Down
7 changes: 6 additions & 1 deletion styles/widgets/common/fileManager.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
flex-direction: column;
}

.dx-filemanager-notification-drawer {
.dx-filemanager-notification-drawer,
.dx-filemanager-notification-drawer-panel {
height: 100%;
}

Expand Down Expand Up @@ -171,6 +172,10 @@
box-sizing: border-box;
overflow: hidden;

.dx-filemanager-adaptivity-drawer-panel {
height: 100%;
}

.dx-filemanager-dirs-panel {
padding: 5px 10px;
height: 100%;
Expand Down