mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Renamed .ss-tabset to .cms-tabset in cms templates to distinguish entwine selectors and add extra functionality (cookies, re-selecting tab, panel loading)
This commit is contained in:
parent
d6eb1b6fff
commit
84b0a7d96c
@ -121,7 +121,7 @@ body, html { font-size: 12px; line-height: 16px; font-family: Arial, sans-serif;
|
|||||||
.cms .ui-tabs .ui-tabs-nav li { top: 0; }
|
.cms .ui-tabs .ui-tabs-nav li { top: 0; }
|
||||||
.cms .ui-tabs .ui-tabs-nav li a { padding: 0 15px; }
|
.cms .ui-tabs .ui-tabs-nav li a { padding: 0 15px; }
|
||||||
.cms .ui-tabs .ui-tabs-nav.ui-state-active { border-color: gray; }
|
.cms .ui-tabs .ui-tabs-nav.ui-state-active { border-color: gray; }
|
||||||
.cms .ui-tabs .ui-tabs-panel { background: transparent; padding: 0; }
|
.cms .ui-tabs .ui-tabs-panel { background: transparent; }
|
||||||
.cms .ui-widget-content, .cms .ui-widget { color: #444444; font-size: 12px; font-family: Arial, sans-serif; border: 0; }
|
.cms .ui-widget-content, .cms .ui-widget { color: #444444; font-size: 12px; font-family: Arial, sans-serif; border: 0; }
|
||||||
.cms .ui-widget-header { background-color: #b0bec7; padding: 8px 8px 6px 8px; border-bottom: 2px solid #8399a7; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2RkZTNlNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzkyYTViMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dde3e7), color-stop(100%, #92a5b2)); background-image: -webkit-linear-gradient(#dde3e7, #92a5b2); background-image: -moz-linear-gradient(#dde3e7, #92a5b2); background-image: -o-linear-gradient(#dde3e7, #92a5b2); background-image: -ms-linear-gradient(#dde3e7, #92a5b2); background-image: linear-gradient(#dde3e7, #92a5b2); border-bottom: 3px solid #5c7382; padding: 8px; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; }
|
.cms .ui-widget-header { background-color: #b0bec7; padding: 8px 8px 6px 8px; border-bottom: 2px solid #8399a7; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2RkZTNlNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzkyYTViMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dde3e7), color-stop(100%, #92a5b2)); background-image: -webkit-linear-gradient(#dde3e7, #92a5b2); background-image: -moz-linear-gradient(#dde3e7, #92a5b2); background-image: -o-linear-gradient(#dde3e7, #92a5b2); background-image: -ms-linear-gradient(#dde3e7, #92a5b2); background-image: linear-gradient(#dde3e7, #92a5b2); border-bottom: 3px solid #5c7382; padding: 8px; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; }
|
||||||
.cms .ui-widget-header .ui-dialog-title { padding: 6px 0; text-shadow: #ced7dc 1px 1px 0; }
|
.cms .ui-widget-header .ui-dialog-title { padding: 6px 0; text-shadow: #ced7dc 1px 1px 0; }
|
||||||
@ -488,20 +488,20 @@ form.member-profile-form .ui-tabs-nav .ui-corner-all, form.member-profile-form .
|
|||||||
.ui-dialog .ui-dialog-titlebar.ui-widget-header .ui-dialog-title { position: absolute; }
|
.ui-dialog .ui-dialog-titlebar.ui-widget-header .ui-dialog-title { position: absolute; }
|
||||||
.ui-dialog .cms-dialog-content { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; padding-bottom: 8px; padding-top: 0px; }
|
.ui-dialog .cms-dialog-content { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; padding-bottom: 8px; padding-top: 0px; }
|
||||||
.ui-dialog .cms-dialog-content .Actions { overflow: auto; margin: 8px 0; padding-bottom: 8px; float: right; }
|
.ui-dialog .cms-dialog-content .Actions { overflow: auto; margin: 8px 0; padding-bottom: 8px; float: right; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset { -moz-border-radius: none; -webkit-border-radius: none; -o-border-radius: none; -ms-border-radius: none; -khtml-border-radius: none; border-radius: none; }
|
.ui-dialog .cms-dialog-content .cms-tabset { -moz-border-radius: none; -webkit-border-radius: none; -o-border-radius: none; -ms-border-radius: none; -khtml-border-radius: none; border-radius: none; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset .tab { background: none; overflow-y: auto; }
|
.ui-dialog .cms-dialog-content .cms-tabset .tab { background: none; overflow-y: auto; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs { background: none; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs { background: none; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav { border: none; padding: 0 40px 0 0; float: right; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav { border: none; padding: 0 40px 0 0; float: right; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li { margin: 0; font-weight: bold; line-height: 16px; padding: 12px 12px 10px; border-bottom: 2px solid #B3B3B3; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav li { margin: 0; font-weight: bold; line-height: 16px; padding: 12px 12px 10px; border-bottom: 2px solid #B3B3B3; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: -1px; padding-bottom: 11px; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: -1px; padding-bottom: 11px; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav li:first-child { margin-left: 15px; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav li:first-child { margin-left: 15px; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-state-focus a { outline: none; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-state-focus a { outline: none; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-state-default, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-default, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-default { background-color: #b0bec7; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzhjYTFhZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #8ca1ae)); background-image: -webkit-linear-gradient(#b0bec7, #8ca1ae); background-image: -moz-linear-gradient(#b0bec7, #8ca1ae); background-image: -o-linear-gradient(#b0bec7, #8ca1ae); background-image: -ms-linear-gradient(#b0bec7, #8ca1ae); background-image: linear-gradient(#b0bec7, #8ca1ae); border-right-color: #a6a6a6; border-left-color: #d9d9d9; border-bottom: none; border-top: none; text-shadow: white 0 1px 0; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-state-default, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-default, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-default { background-color: #b0bec7; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzhjYTFhZSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #8ca1ae)); background-image: -webkit-linear-gradient(#b0bec7, #8ca1ae); background-image: -moz-linear-gradient(#b0bec7, #8ca1ae); background-image: -o-linear-gradient(#b0bec7, #8ca1ae); background-image: -ms-linear-gradient(#b0bec7, #8ca1ae); background-image: linear-gradient(#b0bec7, #8ca1ae); border-right-color: #a6a6a6; border-left-color: #d9d9d9; border-bottom: none; border-top: none; text-shadow: white 0 1px 0; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-state-active, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-active, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-active { background: #eceff1; border-right-color: #a6a6a6; border-left-color: #a6a6a6; margin-right: -1px; margin-left: -3px; z-index: 2; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-state-active, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-active, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-active { background: #eceff1; border-right-color: #a6a6a6; border-left-color: #a6a6a6; margin-right: -1px; margin-left: -3px; z-index: 2; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-state-active a, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-active a, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-active a { border-bottom: none; border-top: none; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-state-active a, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-content .ui-state-active a, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-widget-header .ui-state-active a { border-bottom: none; border-top: none; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-all, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-top, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-right, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-tr { border-radius: 0; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-all, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-top, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-right, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-tr { border-radius: 0; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-all, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-top, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-left, .ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-nav .ui-corner-tl { border-radius: 0; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-all, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-top, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-left, .ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-nav .ui-corner-tl { border-radius: 0; }
|
||||||
.ui-dialog .cms-dialog-content .ss-tabset.ui-tabs .ui-tabs-panel { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; overflow-x: hidden; clear: both; border-top: 1px solid #a6a6a6; }
|
.ui-dialog .cms-dialog-content .cms-tabset.ui-tabs .ui-tabs-panel { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; overflow-x: hidden; clear: both; border-top: 1px solid #a6a6a6; }
|
||||||
.ui-dialog .cms-dialog-content .clear { clear: both; }
|
.ui-dialog .cms-dialog-content .clear { clear: both; }
|
||||||
.ui-dialog.loading { background-image: url(../images/spinner.gif); background-position: 50% 50%; background-repeat: no-repeat; }
|
.ui-dialog.loading { background-image: url(../images/spinner.gif); background-position: 50% 50%; background-repeat: no-repeat; }
|
||||||
|
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
// Force initialization of tabsets to avoid layout glitches
|
// Force initialization of tabsets to avoid layout glitches
|
||||||
this.find('.ss-tabset').redrawTabs();
|
this.find('.cms-tabset').redrawTabs();
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// Force initialization of tabsets to avoid layout glitches
|
// Force initialization of tabsets to avoid layout glitches
|
||||||
this.add(this.find('.ss-tabset')).redrawTabs();
|
this.add(this.find('.cms-tabset')).redrawTabs();
|
||||||
|
|
||||||
this.layout();
|
this.layout();
|
||||||
},
|
},
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
// save tab selections in order to reconstruct them later
|
// save tab selections in order to reconstruct them later
|
||||||
var selectedTabs = [];
|
var selectedTabs = [];
|
||||||
form.find('.ss-tabset').each(function(i, el) {
|
form.find('.cms-tabset').each(function(i, el) {
|
||||||
if($(el).attr('id')) selectedTabs.push({id:$(el).attr('id'), selected:$(el).tabs('option', 'selected')});
|
if($(el).attr('id')) selectedTabs.push({id:$(el).attr('id'), selected:$(el).tabs('option', 'selected')});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -99,7 +99,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-init tabs (in case the form tag itself is a tabset)
|
// Re-init tabs (in case the form tag itself is a tabset)
|
||||||
if(self.hasClass('ss-tabset')) self.removeClass('ss-tabset').addClass('ss-tabset');
|
if(self.hasClass('cms-tabset')) self.removeClass('cms-tabset').addClass('cms-tabset');
|
||||||
|
|
||||||
// re-select previously saved tabs
|
// re-select previously saved tabs
|
||||||
$.each(selectedTabs, function(i, selectedTab) {
|
$.each(selectedTabs, function(i, selectedTab) {
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// Force initialization of tabsets to avoid layout glitches
|
// Force initialization of tabsets to avoid layout glitches
|
||||||
this.add(this.find('.ss-tabset')).redrawTabs();
|
this.add(this.find('.cms-tabset')).redrawTabs();
|
||||||
|
|
||||||
var approxWidth = $('.cms-container').width() - $('.cms-menu').width();
|
var approxWidth = $('.cms-container').width() - $('.cms-menu').width();
|
||||||
this.find('.cms-content-actions').width(approxWidth).height('auto');
|
this.find('.cms-content-actions').width(approxWidth).height('auto');
|
||||||
|
@ -1252,7 +1252,7 @@ form.member-profile-form {
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ss-tabset {
|
.cms-tabset {
|
||||||
@include border-radius(none);
|
@include border-radius(none);
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
|
@ -2,10 +2,6 @@
|
|||||||
$.entwine('ss', function($){
|
$.entwine('ss', function($){
|
||||||
/**
|
/**
|
||||||
* Lightweight wrapper around jQuery UI tabs.
|
* Lightweight wrapper around jQuery UI tabs.
|
||||||
* Ensures that anchor links are set properly,
|
|
||||||
* and any nested tabs are scrolled if they have
|
|
||||||
* their height explicitly set. This is important
|
|
||||||
* for forms inside the CMS layout.
|
|
||||||
*/
|
*/
|
||||||
$('.ss-tabset').entwine({
|
$('.ss-tabset').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
@ -16,13 +12,7 @@
|
|||||||
|
|
||||||
redrawTabs: function() {
|
redrawTabs: function() {
|
||||||
this.rewriteHashlinks();
|
this.rewriteHashlinks();
|
||||||
|
this.tabs();
|
||||||
var id = this.attr('id'), cookieId = 'ui-tabs-' + id;
|
|
||||||
|
|
||||||
// Fix for wrong cookie storage of deselected tabs
|
|
||||||
if($.cookie && id && $.cookie(cookieId) == -1) $.cookie(cookieId, 0);
|
|
||||||
|
|
||||||
this.tabs({cookie: ($.cookie && id) ? { expires: 30, path: '/', name: cookieId } : false});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user