summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-10-31 15:37:48 +0100
committerGitHub <noreply@github.com>2018-10-31 15:37:48 +0100
commit838105877c7b426f5c0e75699df096a80198d39c (patch)
treef18cc70ea48b0e3ccdcaa64e20aadeca03d7b941
parent1086cbbe61f448adaad9a94b30d0bd2925e6dda1 (diff)
parent53aad9901dba5ee1d5040a1f902c18177f82c377 (diff)
downloadnextcloud-server-838105877c7b426f5c0e75699df096a80198d39c.tar.gz
nextcloud-server-838105877c7b426f5c0e75699df096a80198d39c.zip
Merge pull request #11647 from nextcloud/make-possible-for-tab-views-to-add-css-classes-to-their-container
Make possible for tab views to add CSS classes to their container
-rw-r--r--apps/files/js/detailsview.js3
-rw-r--r--apps/files/js/detailtabview.js15
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js
index cd602961c0a..bac2a5ebd21 100644
--- a/apps/files/js/detailsview.js
+++ b/apps/files/js/detailsview.js
@@ -174,6 +174,9 @@
// hide other tabs
$tabsContainer.find('.tab').addClass('hidden');
+ $tabsContainer.attr('class', 'tabsContainer');
+ $tabsContainer.addClass(tabView.getTabsContainerExtraClasses());
+
// tab already rendered ?
if (!$tabEl.length) {
// render tab
diff --git a/apps/files/js/detailtabview.js b/apps/files/js/detailtabview.js
index a66cedbc15d..1e046f30246 100644
--- a/apps/files/js/detailtabview.js
+++ b/apps/files/js/detailtabview.js
@@ -41,6 +41,21 @@
},
/**
+ * Returns the extra CSS classes used by the tabs container when this
+ * tab is the selected one.
+ *
+ * In general you should not extend this method, as tabs should not
+ * modify the classes of its container; this is reserved as a last
+ * resort for very specific cases in which there is no other way to get
+ * the proper style or behaviour.
+ *
+ * @return {String} space-separated CSS classes
+ */
+ getTabsContainerExtraClasses: function() {
+ return '';
+ },
+
+ /**
* Returns the tab label
*
* @return {String} label