diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-08-31 00:38:18 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-08-31 00:38:18 +0200 |
commit | 89b603a4b33ab1aa999518a7bb5aca6e6491e0ad (patch) | |
tree | 4d7cd36cd9f790e3537acb6cf99339f52e9d2e2b | |
parent | 0167225686ba44907aa5e41d848e54fcb0ac7434 (diff) | |
parent | c6053daf43397e39fb6e15317f1539a51a223e83 (diff) | |
download | nextcloud-server-89b603a4b33ab1aa999518a7bb5aca6e6491e0ad.tar.gz nextcloud-server-89b603a4b33ab1aa999518a7bb5aca6e6491e0ad.zip |
Merge pull request #18671 from owncloud/cleanup-sidebar-semantics
Removes unecessary divs and adds max width to longer names.
-rw-r--r-- | apps/files/css/detailsView.css | 15 | ||||
-rw-r--r-- | apps/files/js/detailsview.js | 17 | ||||
-rw-r--r-- | apps/files/js/mainfileinfodetailview.js | 19 | ||||
-rw-r--r-- | apps/files/tests/js/mainfileinfodetailviewSpec.js | 8 |
4 files changed, 36 insertions, 23 deletions
diff --git a/apps/files/css/detailsView.css b/apps/files/css/detailsView.css index dafd8c24573..ffead923124 100644 --- a/apps/files/css/detailsView.css +++ b/apps/files/css/detailsView.css @@ -9,11 +9,20 @@ #app-sidebar .mainFileInfoView { margin-right: 20px; /* accomodate for close icon */ + float:left; + display:block; + width: 100%; +} + +#app-sidebar .file-details-container { + display: inline-block; + float: left; } #app-sidebar .thumbnail { width: 75px; height: 75px; + display: inline-block; float: left; margin-right: 10px; background-size: 75px; @@ -31,10 +40,16 @@ padding-bottom: 3px; } +#app-sidebar .fileName h3 { + max-width: 300px; + float:left; +} + #app-sidebar .file-details { margin-top: 3px; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; opacity: .5; + float:left; } #app-sidebar .action-favorite { vertical-align: text-bottom; diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index a4ebe90cd64..83d7fd4a178 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -10,24 +10,20 @@ (function() { var TEMPLATE = - '<div>' + ' <div class="detailFileInfoContainer">' + ' </div>' + - ' <div>' + - ' {{#if tabHeaders}}' + - ' <ul class="tabHeaders">' + + ' {{#if tabHeaders}}' + + ' <ul class="tabHeaders">' + ' {{#each tabHeaders}}' + ' <li class="tabHeader" data-tabid="{{tabId}}" data-tabindex="{{tabIndex}}">' + ' <a href="#">{{label}}</a>' + ' </li>' + ' {{/each}}' + - ' </ul>' + - ' {{/if}}' + - ' <div class="tabsContainer">' + - ' </div>' + + ' </ul>' + + ' {{/if}}' + + ' <div class="tabsContainer">' + ' </div>' + - ' <a class="close icon-close" href="#" alt="{{closeLabel}}"></a>' + - '</div>'; + ' <a class="close icon-close" href="#" alt="{{closeLabel}}"></a>'; /** * @class OCA.Files.DetailsView @@ -268,4 +264,3 @@ OCA.Files.DetailsView = DetailsView; })(); - diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index 513f833299a..f647a0de2a9 100644 --- a/apps/files/js/mainfileinfodetailview.js +++ b/apps/files/js/mainfileinfodetailview.js @@ -10,14 +10,17 @@ (function() { var TEMPLATE = - '<a href="#" class="thumbnail action-default"></a><div title="{{name}}" class="fileName ellipsis">{{name}}</div>' + - '<div class="file-details ellipsis">' + - ' <a href="#" ' + - ' alt="{{starAltText}}"' + - ' class="action action-favorite favorite">' + - ' <img class="svg" src="{{starIcon}}" />' + - ' </a>' + - ' {{#if hasSize}}<span class="size" title="{{altSize}}">{{size}}</span>, {{/if}}<span class="date" title="{{altDate}}">{{date}}</span>' + + '<a href="#" class="thumbnail action-default"></a>' + + '<div class="file-details-container">' + + '<div class="fileName"><h3 title="{{name}}" class="ellipsis">{{name}}</h3></div>' + + ' <div class="file-details ellipsis">' + + ' <a href="#" ' + + ' alt="{{starAltText}}"' + + ' class="action action-favorite favorite">' + + ' <img class="svg" src="{{starIcon}}" />' + + ' </a>' + + ' {{#if hasSize}}<span class="size" title="{{altSize}}">{{size}}</span>, {{/if}}<span class="date" title="{{altDate}}">{{date}}</span>' + + ' </div>' + '</div>'; /** diff --git a/apps/files/tests/js/mainfileinfodetailviewSpec.js b/apps/files/tests/js/mainfileinfodetailviewSpec.js index 582824585b5..3d78312c86e 100644 --- a/apps/files/tests/js/mainfileinfodetailviewSpec.js +++ b/apps/files/tests/js/mainfileinfodetailviewSpec.js @@ -55,8 +55,8 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { var clock = sinon.useFakeTimers(Date.UTC(2015, 6, 17, 1, 2, 0, 3)); var dateExpected = OC.Util.formatDate(Date(Date.UTC(2015, 6, 17, 1, 2, 0, 0))); view.setFileInfo(testFileInfo); - expect(view.$el.find('.fileName').text()).toEqual('One.txt'); - expect(view.$el.find('.fileName').attr('title')).toEqual('One.txt'); + expect(view.$el.find('.fileName h3').text()).toEqual('One.txt'); + expect(view.$el.find('.fileName h3').attr('title')).toEqual('One.txt'); expect(view.$el.find('.size').text()).toEqual('117.7 MB'); expect(view.$el.find('.size').attr('title')).toEqual('123456789 bytes'); expect(view.$el.find('.date').text()).toEqual('a few seconds ago'); @@ -110,8 +110,8 @@ describe('OCA.Files.MainFileInfoDetailView tests', function() { testFileInfo.set('displayName', 'hello.txt'); view.setFileInfo(testFileInfo); - expect(view.$el.find('.fileName').text()).toEqual('hello.txt'); - expect(view.$el.find('.fileName').attr('title')).toEqual('hello.txt'); + expect(view.$el.find('.fileName h3').text()).toEqual('hello.txt'); + expect(view.$el.find('.fileName h3').attr('title')).toEqual('hello.txt'); }); it('rerenders when changes are made on the model', function() { view.setFileInfo(testFileInfo); |