summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:55:38 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:55:38 +0200
commit72024ad201dd9f232eee5ab57d8e08ccecb7179a (patch)
treeff85dd4e5f1c6359da66770aba5db8ef03540a3a /apps/files/js
parentd007c32907fbd0f11e8866b9f735d8eab78b06d9 (diff)
parent5e4a52d3c259e77065dbb5f0766b0d08f2e1babb (diff)
downloadnextcloud-server-72024ad201dd9f232eee5ab57d8e08ccecb7179a.tar.gz
nextcloud-server-72024ad201dd9f232eee5ab57d8e08ccecb7179a.zip
Merge pull request #19404 from owncloud/files-sidebar-sorttabs
Fix tabs order in files sidebar
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/detailsview.js8
-rw-r--r--apps/files/js/detailtabview.js6
2 files changed, 13 insertions, 1 deletions
diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js
index b01f9cea610..bad4be4ceef 100644
--- a/apps/files/js/detailsview.js
+++ b/apps/files/js/detailsview.js
@@ -132,6 +132,14 @@
closeLabel: t('files', 'Close')
};
+ this._tabViews = this._tabViews.sort(function(tabA, tabB) {
+ var orderA = tabA.order || 0;
+ var orderB = tabB.order || 0;
+ if (orderA === orderB) {
+ return OC.Util.naturalSortCompare(tabA.getLabel(), tabB.getLabel());
+ }
+ return orderA - orderB;
+ });
if (this._tabViews.length > 1) {
// only render headers if there is more than one available
templateVars.tabHeaders = _.map(this._tabViews, function(tabView, i) {
diff --git a/apps/files/js/detailtabview.js b/apps/files/js/detailtabview.js
index 449047cf252..d885e47b15e 100644
--- a/apps/files/js/detailtabview.js
+++ b/apps/files/js/detailtabview.js
@@ -29,11 +29,15 @@
_template: null,
- initialize: function() {
+ initialize: function(options) {
+ options = options || {};
if (!this.id) {
this.id = 'detailTabView' + DetailTabView._TAB_COUNT;
DetailTabView._TAB_COUNT++;
}
+ if (options.order) {
+ this.order = options.order || 0;
+ }
},
/**