Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:perka/backbone-ui

  • Loading branch information...
commit 98653344683dd7af9e6c82d7a68d7faa87879767 2 parents d911ca2 + ca63813
@jamesstrate jamesstrate authored
View
BIN  doc/src/skins/perka/images/table_sort_arrows.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 doc/src/skins/perka/perka.css
@@ -191,3 +191,21 @@
.skin_perka .radio_group.error a.choice {
background-position: 0 -113px;
}
+
+.skin_perka .table_view .sorted .sort_wrapper .glyph {
+ display:none;
+}
+
+.skin_perka .table_view .sorted .sort_wrapper.desc {
+ background:url(./images/table_sort_arrows.png) 0 0 no-repeat;
+ width: 9px;
+ height: 10px;
+ margin-top:11px;
+}
+
+.skin_perka .table_view .sorted .sort_wrapper.asc {
+ background:url(./images/table_sort_arrows.png) 0 -10px no-repeat;
+ width: 9px;
+ height: 10px;
+ margin-top:10px;
+}
View
13 src/css/table_view.css
@@ -43,16 +43,13 @@
cursor:pointer;
}
-.table_view .glyph {
+.table_view th .wrapper,
+.table_view th.sorted .sort_wrapper {
float:left;
- margin-top:6px;
- font-size:10px;
}
-.table_view th.first .glyph {
- padding-left:5px;
+.table_view th.sorted .sort_wrapper .glyph {
+ margin-top:6px;
+ font-size:10px;
}
-.table_view .sorted {
- padding-left:16px;
-}
View
15 src/js/table_view.js
@@ -59,25 +59,24 @@
return item1.get(column.content) < item2.get(column.content) ? -1 :
item1.get(column.content) > item2.get(column.content) ? 1 : 0;
};
+
var firstSort = (sortFirstColumn && firstHeading === null);
var sortHeader = this._sortState.content === column.content || firstSort;
- var sortLabel = $.el.div({
- className : 'glyph'
- }, sortHeader ? (this._sortState.reverse && !firstSort ? '\u25b2 ' : '\u25bc ') : '');
+ var sortClass = sortHeader ? (this._sortState.reverse && !firstSort ? ' asc' : ' desc') : '';
+ var sortLabel = $.el.div({className : 'glyph'},
+ sortClass === ' asc' ? '\u25b2 ' : sortClass === ' desc' ? '\u25bc ' : '');
var onclick = this.options.sortable ? (_(this.options.onSort).isFunction() ?
_(function(e) { this.options.onSort(column); }).bind(this) :
_(function(e, silent) { this._sort(column, silent); }).bind(this)) : Backbone.UI.noop;
var th = $.el.th({
- className : _(list).nameForIndex(index),
+ className : _(list).nameForIndex(index) + (sortHeader ? ' sorted' : ''),
style : style,
onclick : onclick
},
- sortLabel,
- $.el.div({
- className : 'wrapper' + (sortHeader ? ' sorted' : '')
- }, label)).appendTo(headingRow);
+ $.el.div({className : 'wrapper' + (sortHeader ? ' sorted' : '')}, label),
+ sortHeader ? $.el.div({className : 'sort_wrapper' + sortClass}, sortLabel) : null).appendTo(headingRow);
if (firstHeading === null) firstHeading = th;
}).bind(this));
Please sign in to comment.
Something went wrong with that request. Please try again.