updated bootstrap, jquery. Added sortable/partially hidable tables
This commit is contained in:
2362
static/js/bootstrap.js
vendored
2362
static/js/bootstrap.js
vendored
File diff suppressed because one or more lines are too long
7
static/js/bootstrap.min.js
vendored
Normal file
7
static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4543
static/js/jquery.js
vendored
4543
static/js/jquery.js
vendored
File diff suppressed because it is too large
Load Diff
@ -67,3 +67,48 @@ function checkOrders() {
|
||||
|
||||
}
|
||||
|
||||
function sortTableBy(tblSel,col,des,desc) {
|
||||
var rows = $(tblSel + ' > tbody > tr');
|
||||
rows.detach();
|
||||
rows = rows.sort(function(a,b) {
|
||||
fst = $($(a).children()[col]);
|
||||
snd = $($(b).children()[col]);
|
||||
res = 0;
|
||||
if (fst.hasClass('numeric')) {
|
||||
res = parseFloat(fst.text().replace(/\./g,"").replace(",","."))
|
||||
- parseFloat(snd.text().replace(/\./g,"").replace(",","."));
|
||||
} else {
|
||||
if (fst.text() == snd.text())
|
||||
res = $($(a).children()[des]).text() < $($(b).children()[des]).text() ? -1 : 1;
|
||||
else
|
||||
res = fst.text() < snd.text() ? -1 : 1;
|
||||
}
|
||||
if (desc)
|
||||
return res;
|
||||
else
|
||||
return -1*res;
|
||||
});
|
||||
rows.appendTo($(tblSel + ' > tbody'));
|
||||
}
|
||||
|
||||
function hideTableCol(tblSel, col, resetGroup) {
|
||||
var desc = $($(tblSel + ' > thead > tr').children()[col]).text();
|
||||
var rows = $(tblSel + ' > * > tr');
|
||||
rows.each(function(id,elem) {
|
||||
$($(elem).children()[col]).fadeOut();
|
||||
});
|
||||
var restore = $('<a class="btn" role="button">Show '+desc+'</a>');
|
||||
restore.on('click', function() {
|
||||
showTableCol(tblSel,col,restore);
|
||||
});
|
||||
$(resetGroup).append(restore);
|
||||
}
|
||||
|
||||
function showTableCol(tblSel, col, resetButton) {
|
||||
var rows = $(tblSel + ' > * > tr');
|
||||
rows.each(function(id,elem) {
|
||||
$($(elem).children()[col]).fadeIn();
|
||||
});
|
||||
$(resetButton).remove();
|
||||
}
|
||||
|
||||
|
13
static/js/npm.js
Normal file
13
static/js/npm.js
Normal file
@ -0,0 +1,13 @@
|
||||
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
|
||||
require('../../js/transition.js')
|
||||
require('../../js/alert.js')
|
||||
require('../../js/button.js')
|
||||
require('../../js/carousel.js')
|
||||
require('../../js/collapse.js')
|
||||
require('../../js/dropdown.js')
|
||||
require('../../js/modal.js')
|
||||
require('../../js/tooltip.js')
|
||||
require('../../js/popover.js')
|
||||
require('../../js/scrollspy.js')
|
||||
require('../../js/tab.js')
|
||||
require('../../js/affix.js')
|
Reference in New Issue
Block a user