commit
f647e0f5cd
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 139 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,103 +0,0 @@ |
||||
//-- copyright
|
||||
// OpenProject is a project management system.
|
||||
// Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License version 3.
|
||||
//
|
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
|
||||
// Copyright (C) 2006-2017 Jean-Philippe Lang
|
||||
// Copyright (C) 2010-2013 the ChiliProject Team
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
//
|
||||
// See docs/COPYRIGHT.rdoc for more details.
|
||||
//++
|
||||
|
||||
/* |
||||
This module is responsible to manage tabed views in OpenProject, |
||||
which you can observe, for example, in the settings page. |
||||
Used by view/common/_tabs.html.erb in inline javascript. |
||||
*/ |
||||
|
||||
/* |
||||
There are hidden buttons in the common/_tabs.html.erb view, |
||||
which shall allow the user to scrolls through the tab captions. |
||||
Those buttons are only visible if there is not enough room to |
||||
display all tab captions at once. |
||||
*/ |
||||
|
||||
// Check if there is enough room to display all tab captions
|
||||
// and show/hide the tabButtons accordingly.
|
||||
function displayTabsButtons() { |
||||
var lis; |
||||
var tabsWidth = 0; |
||||
var el; |
||||
jQuery('div.tabs').each(function() { |
||||
el = jQuery(this); |
||||
lis = el.find('ul').children(); |
||||
lis.each(function(){ |
||||
if (jQuery(this).is(':visible')) { |
||||
tabsWidth += jQuery(this).width() + 6; |
||||
} |
||||
}); |
||||
if ((tabsWidth < el.width() - 60) && (lis.first().is(':visible'))) { |
||||
el.find('div.tabs-buttons').hide(); |
||||
} else { |
||||
el.find('div.tabs-buttons').show(); |
||||
} |
||||
}); |
||||
} |
||||
|
||||
// scroll the tab caption list right
|
||||
function moveTabRight() { |
||||
var el = jQuery(this); |
||||
var lis = el.parents('div.tabs').first().find('ul').children(); |
||||
var tabsWidth = 0; |
||||
var i = 0; |
||||
lis.each(function() { |
||||
if (jQuery(this).is(':visible')) { |
||||
tabsWidth += jQuery(this).width() + 6; |
||||
} |
||||
}); |
||||
if (tabsWidth < jQuery(el).parents('div.tabs').first().width() - 60) { return; } |
||||
while (i<lis.length && !lis.eq(i).is(':visible')) { i++; } |
||||
lis.eq(i).hide(); |
||||
} |
||||
|
||||
// scroll the tab caption list left
|
||||
function moveTabLeft() { |
||||
var el = jQuery(this); |
||||
var lis = el.parents('div.tabs').first().find('ul').children(); |
||||
var i = 0; |
||||
while (i < lis.length && !lis.eq(i).is(':visible')) { i++; } |
||||
if (i > 0) { |
||||
lis.eq(i-1).show(); |
||||
} |
||||
} |
||||
|
||||
jQuery(function($) { |
||||
if (jQuery('div.tabs').length === 0) { |
||||
return; |
||||
} |
||||
|
||||
// Show tabs
|
||||
displayTabsButtons(); |
||||
$(window).resize(function() { displayTabsButtons(); }); |
||||
|
||||
$('.tab-left').click(moveTabLeft); |
||||
$('.tab-right').click(moveTabRight); |
||||
}); |
||||
|
@ -1,94 +0,0 @@ |
||||
//-- copyright |
||||
// OpenProject is a project management system. |
||||
// Copyright (C) 2012-2018 the OpenProject Foundation (OPF) |
||||
// |
||||
// This program is free software; you can redistribute it and/or |
||||
// modify it under the terms of the GNU General Public License version 3. |
||||
// |
||||
// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: |
||||
// Copyright (C) 2006-2017 Jean-Philippe Lang |
||||
// Copyright (C) 2010-2013 the ChiliProject Team |
||||
// |
||||
// This program is free software; you can redistribute it and/or |
||||
// modify it under the terms of the GNU General Public License |
||||
// as published by the Free Software Foundation; either version 2 |
||||
// of the License, or (at your option) any later version. |
||||
// |
||||
// This program is distributed in the hope that it will be useful, |
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
// GNU General Public License for more details. |
||||
// |
||||
// You should have received a copy of the GNU General Public License |
||||
// along with this program; if not, write to the Free Software |
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||
// |
||||
// See docs/COPYRIGHT.rdoc for more details. |
||||
//++ |
||||
|
||||
/***** Tabs **** |
||||
|
||||
#content .tabs, |
||||
.tabs--container |
||||
position: relative |
||||
height: 2.6em |
||||
margin-bottom: 1.2em |
||||
z-index: 1 |
||||
overflow: hidden |
||||
// necessary to overwrite foundations styling of .tabs |
||||
display: block |
||||
|
||||
ul |
||||
position: relative |
||||
white-space: nowrap |
||||
margin-top: 0.75rem |
||||
margin-left: 0 |
||||
bottom: 0 |
||||
padding-left: 1em |
||||
border-bottom: 1px solid #bbbbbb |
||||
overflow: hidden |
||||
li |
||||
display: inline-block |
||||
list-style-type: none |
||||
white-space: nowrap |
||||
margin-right: 4px |
||||
background: #fff |
||||
margin-bottom: -1px |
||||
a |
||||
display: block |
||||
font-size: 0.9em |
||||
text-decoration: none |
||||
line-height: 1.3em |
||||
padding: 4px 6px 4px 6px |
||||
border: 1px solid #ccc |
||||
background-color: #eeeeee |
||||
color: #333 |
||||
font-weight: bold |
||||
&:hover |
||||
background-color: #ffffdd |
||||
text-decoration: none |
||||
&.selected |
||||
background-color: #fff |
||||
&.-disabled |
||||
color: #999 |
||||
|
||||
div.tabs-buttons |
||||
position: absolute |
||||
right: 0 |
||||
bottom: 4px |
||||
|
||||
button |
||||
&.tab-left, &.tab-right |
||||
font-size: 0.9em |
||||
cursor: pointer |
||||
height: 24px |
||||
border: 1px solid #ccc |
||||
border-bottom: 1px solid #bbbbbb |
||||
position: absolute |
||||
padding: 4px |
||||
width: 20px |
||||
bottom: -1px |
||||
&.tab-left |
||||
right: 20px |
||||
&.tab-right |
||||
right: 0 |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue