diff --git a/customize.dist/src/less2/include/drive.less b/customize.dist/src/less2/include/drive.less index 1aec980d0..623e2b88b 100644 --- a/customize.dist/src/less2/include/drive.less +++ b/customize.dist/src/less2/include/drive.less @@ -805,6 +805,19 @@ } + .cp-toolbar-bottom { + .cp-toolbar-bottom-right { + .fa-history { order: 50; } + .fa-list, .fa-th-large { order: 25; } + #cp-app-drive-toolbar-context-mobile, #cp-app-drive-toolbar-contextbuttons { order: 0; } + #cp-app-drive-toolbar-contextbuttons { + height: @variables_bar-height; + display: flex; + align-items: center; + } + } + } + /* Toolbar */ #cp-app-drive-toolbar { diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 2729c6fb0..e15b36011 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -556,6 +556,7 @@ define([ APP.origin = priv.origin; APP.hideDuplicateOwned = Util.find(priv, ['settings', 'drive', 'hideDuplicate']); APP.closed = false; + APP.toolbar = driveConfig.toolbar; var $readOnly = $(h('div#cp-app-drive-edition-state.cp-app-drive-content-info-box', Messages.readonly)); @@ -582,7 +583,7 @@ define([ var $tree = APP.$tree = $("#cp-app-drive-tree"); var $content = APP.$content = $("#cp-app-drive-content"); var $appContainer = $(".cp-app-drive-container"); - var $driveToolbar = $("#cp-app-drive-toolbar"); + var $driveToolbar = APP.toolbar.$bottom; var $contextMenu = createContextMenu().appendTo($appContainer); var $contentContextMenu = $("#cp-app-drive-context-content"); @@ -2237,8 +2238,12 @@ define([ window.addEventListener("resize", collapseDrivePath); var treeResizeObserver = new MutationObserver(collapseDrivePath); treeResizeObserver.observe($("#cp-app-drive-tree")[0], {"attributes": true}); + + // XXX + /* var toolbarButtonAdditionObserver = new MutationObserver(collapseDrivePath); $(function () { toolbarButtonAdditionObserver.observe($("#cp-app-drive-toolbar")[0], {"childList": true, "subtree": true}); }); + */ // Create the title block with the "parent folder" button @@ -2367,16 +2372,16 @@ define([ var $gridButton = $gridIcon.clone(); $listButton.click(function () { - $gridButton.removeClass('cp-app-drive-toolbar-active'); - $listButton.addClass('cp-app-drive-toolbar-active'); + $gridButton.show(); + $listButton.hide(); setViewMode('list'); $('#' + FOLDER_CONTENT_ID).removeClass('cp-app-drive-content-grid'); $('#' + FOLDER_CONTENT_ID).addClass('cp-app-drive-content-list'); Feedback.send('DRIVE_LIST_MODE'); }); $gridButton.click(function () { - $listButton.removeClass('cp-app-drive-toolbar-active'); - $gridButton.addClass('cp-app-drive-toolbar-active'); + $listButton.show(); + $gridButton.hide(); setViewMode('grid'); $('#' + FOLDER_CONTENT_ID).addClass('cp-app-drive-content-grid'); $('#' + FOLDER_CONTENT_ID).removeClass('cp-app-drive-content-list'); @@ -2384,9 +2389,9 @@ define([ }); if (getViewMode() === 'list') { - $listButton.addClass('cp-app-drive-toolbar-active'); + $listButton.hide(); } else { - $gridButton.addClass('cp-app-drive-toolbar-active'); + $gridButton.hide(); } $listButton.attr('title', Messages.fm_viewListButton); $gridButton.attr('title', Messages.fm_viewGridButton); @@ -3002,20 +3007,16 @@ define([ // Drive content toolbar var createToolbar = function () { - var $toolbar = $driveToolbar; - $toolbar.html(''); - $('