1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-16 04:35:27 +02:00

Fixed bug in paging

This commit is contained in:
koalyptus 2014-12-16 03:25:40 +00:00
parent 26e6e01de6
commit 95ff4b6701
3 changed files with 75 additions and 83 deletions

View file

@ -153,7 +153,7 @@ export class Paging{
this.tf = tf; this.tf = tf;
} }
buildUI{ buildUI(){
var slcPages; var slcPages;
var tf = this.tf; var tf = this.tf;

View file

@ -1,15 +1,16 @@
define(["exports", "../dom", "../string"], function (exports, _dom, _string) { define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
"use strict"; "use strict";
var _classProps = function (child, staticProps, instanceProps) {
if (staticProps) Object.defineProperties(child, staticProps);
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};
var Dom = _dom.Dom; var Dom = _dom.Dom;
var Str = _string.Str; var Str = _string.Str;
var HighlightKeyword = (function () { var HighlightKeyword = (function () {
var HighlightKeyword = function HighlightKeyword(tf) { var HighlightKeyword =
/**
* HighlightKeyword, highlight matched keyword
* @param {Object} tf TableFilter instance
*/
function HighlightKeyword(tf) {
var f = tf.fObj; var f = tf.fObj;
//defines css class for highlighting //defines css class for highlighting
this.highlightCssClass = f.highlight_css_class || "keyword"; this.highlightCssClass = f.highlight_css_class || "keyword";
@ -18,10 +19,7 @@ define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
this.tf = tf; this.tf = tf;
}; };
_classProps(HighlightKeyword, null, { HighlightKeyword.prototype.highlight = function (node, word, cssClass) {
highlight: {
writable: true,
value: function (node, word, cssClass) {
// Iterate into this nodes childNodes // Iterate into this nodes childNodes
if (node.hasChildNodes) { if (node.hasChildNodes) {
var children = node.childNodes; var children = node.childNodes;
@ -50,11 +48,9 @@ define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
} }
} }
} }
} };
},
unhighlight: { HighlightKeyword.prototype.unhighlight = function (word, cssClass) {
writable: true,
value: function (word, cssClass) {
var arrRemove = []; var arrRemove = [];
var highlightedNodes = this.highlightedNodes; var highlightedNodes = this.highlightedNodes;
for (var i = 0; i < highlightedNodes.length; i++) { for (var i = 0; i < highlightedNodes.length; i++) {
@ -80,11 +76,9 @@ define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
for (var k = 0; k < arrRemove.length; k++) { for (var k = 0; k < arrRemove.length; k++) {
highlightedNodes.splice(arrRemove[k], 1); highlightedNodes.splice(arrRemove[k], 1);
} }
} };
},
unhighlightAll: { HighlightKeyword.prototype.unhighlightAll = function () {
writable: true,
value: function () {
if (!this.tf.highlightKeywords || !this.tf.searchArgs) { if (!this.tf.highlightKeywords || !this.tf.searchArgs) {
return; return;
} }
@ -92,9 +86,7 @@ define(["exports", "../dom", "../string"], function (exports, _dom, _string) {
this.unhighlight(this.tf.searchArgs[y], this.highlightCssClass); this.unhighlight(this.tf.searchArgs[y], this.highlightCssClass);
} }
this.highlightedNodes = []; this.highlightedNodes = [];
} };
}
});
return HighlightKeyword; return HighlightKeyword;
})(); })();

File diff suppressed because one or more lines are too long