Pārlūkot izejas kodu

Make possible for tab views to add CSS classes to their container

In general the style of the tabs container should not change depending
on which tab is the currently selected one. However, this could be
needed in some very specific cases, so now the tab views can specify the
extra CSS classes to be used in their container when they are selected.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
tags/v15.0.0beta1
Daniel Calviño Sánchez pirms 5 gadiem
vecāks
revīzija
53aad9901d
2 mainītis faili ar 18 papildinājumiem un 0 dzēšanām
  1. 3
    0
      apps/files/js/detailsview.js
  2. 15
    0
      apps/files/js/detailtabview.js

+ 3
- 0
apps/files/js/detailsview.js Parādīt failu

@@ -194,6 +194,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

+ 15
- 0
apps/files/js/detailtabview.js Parādīt failu

@@ -40,6 +40,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
*

Notiek ielāde…
Atcelt
Saglabāt