Changed buttons on series/logs views to look less cramped

This commit is contained in:
markus101 2014-02-01 16:32:08 -08:00
parent 9515c28729
commit 298837f96a
6 changed files with 64 additions and 25 deletions

View File

@ -15,19 +15,41 @@
@import "../Shared/Styles/card"; @import "../Shared/Styles/card";
@import "../Rename/rename"; @import "../Rename/rename";
.page-toolbar { .toolbar {
margin-top : 10px;
margin-bottom : 30px;
.toolbar-group { &:after {
display: inline-block; visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
} }
.sorting-buttons { .page-toolbar {
.sorting-title { margin-top : 10px;
margin-bottom : 30px;
.toolbar-group {
display: inline-block; display: inline-block;
width: 110px;
} }
.sorting-buttons {
.sorting-title {
display: inline-block;
width: 110px;
}
}
}
}
.toolbars {
margin-top : 5px;
margin-bottom : 30px;
.page-toolbar {
margin-top : 5px;
margin-bottom : 0px;
} }
} }

View File

@ -41,6 +41,7 @@ define(
regions: { regions: {
seriesRegion : '#x-series', seriesRegion : '#x-series',
toolbar : '#x-toolbar', toolbar : '#x-toolbar',
toolbar2 : '#x-toolbar2',
footer : '#x-series-footer' footer : '#x-series-footer'
}, },
@ -237,6 +238,12 @@ define(
}; };
}, },
onShow: function () {
this._showToolbar();
this._renderView();
this._fetchCollection();
},
_showTable: function () { _showTable: function () {
this.currentView = new Backgrid.Grid({ this.currentView = new Backgrid.Grid({
collection: this.seriesCollection, collection: this.seriesCollection,
@ -277,12 +284,6 @@ define(
} }
}, },
onShow: function () {
this._showToolbar();
this._renderView();
this._fetchCollection();
},
_fetchCollection: function () { _fetchCollection: function () {
this.seriesCollection.fetch(); this.seriesCollection.fetch();
}, },
@ -300,8 +301,6 @@ define(
} }
var rightButtons = [ var rightButtons = [
this.sortingOptions,
this.filteringOptions,
this.viewButtons this.viewButtons
]; ];
@ -313,6 +312,17 @@ define(
], ],
context: this context: this
})); }));
this.toolbar2.show(new ToolbarLayout({
right : [
this.filteringOptions
],
left :
[
this.sortingOptions
],
context: this
}));
}, },
_showFooter: function () { _showFooter: function () {

View File

@ -1,4 +1,7 @@
<div id="x-toolbar"></div> <div class="toolbars">
<div id="x-toolbar"></div>
<div id="x-toolbar2"></div>
</div>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">

View File

@ -10,7 +10,8 @@ define(
'underscore' 'underscore'
], function (Marionette, ButtonCollection, ButtonModel, RadioButtonCollectionView, ButtonCollectionView, SortingButtonCollectionView, _) { ], function (Marionette, ButtonCollection, ButtonModel, RadioButtonCollectionView, ButtonCollectionView, SortingButtonCollectionView, _) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Shared/Toolbar/ToolbarLayoutTemplate', template : 'Shared/Toolbar/ToolbarLayoutTemplate',
className: 'toolbar',
ui: { ui: {
left_x : '.x-toolbar-left', left_x : '.x-toolbar-left',

View File

@ -72,7 +72,7 @@ define(
_showToolbar: function () { _showToolbar: function () {
var rightSideButtons = { var leftSideButtons = {
type : 'default', type : 'default',
storeState: false, storeState: false,
items : items :
@ -95,9 +95,9 @@ define(
}; };
this.toolbar.show(new ToolbarLayout({ this.toolbar.show(new ToolbarLayout({
right : left :
[ [
rightSideButtons leftSideButtons
], ],
context: this context: this
})); }));

View File

@ -125,7 +125,7 @@ define(
] ]
}; };
var rightSideButtons = { var leftSideButtons = {
type : 'default', type : 'default',
storeState: false, storeState: false,
items : items :
@ -146,10 +146,13 @@ define(
}; };
this.toolbar.show(new ToolbarLayout({ this.toolbar.show(new ToolbarLayout({
right : left :
[ [
filterButtons, leftSideButtons
rightSideButtons ],
right :
[
filterButtons
], ],
context: this context: this
})); }));