Commit 22321e79 authored by Romain Loth's avatar Romain Loth

Documents view: fix previous commit ('trashAll' duplicates)

parent 631c6f30
...@@ -228,8 +228,8 @@ function transformContent2(rec_id, trClass) { ...@@ -228,8 +228,8 @@ function transformContent2(rec_id, trClass) {
function toggleTrashIt(boxElem) { function toggleTrashIt(boxElem) {
var id = boxElem.id // row_id in the table (not ngram_id) var id = boxElem.id // row_id in the table (not ngram_id)
var val = boxElem.checked var val = boxElem.checked
console.log("striking =>", val) // console.log("striking =>", val)
console.log("record", AjaxRecords[id]) // console.log("record", AjaxRecords[id])
// MyTable.data('dynatable').settings.dataset.originalRecords[id]["del"] = val; // MyTable.data('dynatable').settings.dataset.originalRecords[id]["del"] = val;
AjaxRecords[id]["del"] = val; AjaxRecords[id]["del"] = val;
...@@ -686,25 +686,29 @@ var dupFlag = false ; ...@@ -686,25 +686,29 @@ var dupFlag = false ;
// intercept duplicates query to sort alphabetically **before** duplicates filter // intercept duplicates query to sort alphabetically **before** duplicates filter
$("#div-table").on("dynatable:queries:added", function(e, qname, qval) { $("#div-table").on("dynatable:queries:added", function(e, qname, qval) {
// debug // debug
// console.warn(e) //console.warn(e)
// console.warn("add", qname)
// console.warn("add", qval)
if (!dupFlag && qname == 'docFilter' && qval == "filter_dupl_all") { if (!dupFlag && qname == 'docFilter' && qval == "filter_dupl_all") {
MyTable.data('dynatable').queries.remove('docFilter') MyTable.data('dynatable').queries.remove('docFilter')
// flag to avoid recursion when we'll call this filter again in 4 lines // flag to avoid recursion when we'll call this filter again in 4 lines
dupFlag = true ; dupFlag = true ;
// the sorting // the sorting
MyTable.data('dynatable').sorts.clear(); MyTable.data('dynatable').sorts.clear();
MyTable.data('dynatable').sorts.add('docurl', 1) MyTable.data('dynatable').sorts.add('signature', 1)
// now we can add the query // now we can add the query
MyTable.data('dynatable').queries.add('docFilter', qval) MyTable.data('dynatable').queries.add('docFilter', qval)
MyTable.data('dynatable').process(); MyTable.data('dynatable').process();
} }
else if (qname == 'docFilter') { else if (qname == 'docFilter' && qval != "filter_dupl_all") {
dupFlag = false dupFlag = false
} }
}); });
$("#div-table").on("dynatable:queries:removed", function(e, qname, qval) { $("#div-table").on("dynatable:queries:removed", function(e, qname, qval) {
if (qname == 'filter_dupl_all') { //console.warn(e)
//console.warn("rm", qname)
if (qname == 'docFilter') {
dupFlag = false ; dupFlag = false ;
} }
}); });
......
...@@ -51,7 +51,7 @@ th a { ...@@ -51,7 +51,7 @@ th a {
* NB: top/bottom convention only works because of sort rule that always put smallest id first * NB: top/bottom convention only works because of sort rule that always put smallest id first
*/ */
.duplrowkeep { .duplrowkeep {
border-top: 3px solid black /*border-top: 3px solid black*/
} }
.duplrowdel { .duplrowdel {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment