Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
Revert "v1.0.5"
Browse files Browse the repository at this point in the history
This reverts commit ecb17b1.
  • Loading branch information
Mobius1 committed Mar 27, 2017
1 parent ecb17b1 commit f3fe442
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-datatables",
"version": "1.0.5",
"version": "1.0.4",
"ignore": [
".gitattributes",
"README.md"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-datatables",
"version": "1.0.5",
"version": "1.0.4",
"description": "A lightweight, dependency-free javascript HTML table plugin.",
"main": "vanilla-dataTables.min.js",
"scripts": {
Expand Down
44 changes: 10 additions & 34 deletions vanilla-dataTables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (c) 2015-2017 Karl Saunders (http://mobiuswebdesign.co.uk)
* Licensed under MIT (http://www.opensource.org/licenses/mit-license.php)
*
* Version: 1.0.5
* Version: 1.0.4
*
*/
(function(root, factory) {
Expand All @@ -25,15 +25,8 @@
var util = {
extend: function(src, props) {
var p;
for (p in props) {
if (props.hasOwnProperty(p)) {
if ( typeof src[p] === "object") {
util.extend(src[p], props[p]);
} else {
src[p] = props[p];
}
}
}
for (p in props)
if (props.hasOwnProperty(p)) src[p] = props[p];
return src;
},
each: function(a, b, c) {
Expand Down Expand Up @@ -190,11 +183,8 @@

_ppSelector.value = _.options.perPage;

var string = _.options.labels.perPage.split("{select}");

util.append(label, _ppSelector);
label.insertAdjacentHTML('afterbegin', string[0]);
label.insertAdjacentHTML('beforeend', string[1]);
label.insertAdjacentHTML('beforeend', ' rows per page');
util.append(wrap, label);
util.append(top, wrap);

Expand All @@ -220,7 +210,7 @@
_.input = util.createElement('input', {
type: 'text',
class: 'dataTable-input',
placeholder: _.options.labels.placeholder
placeholder: 'Search...'
});
util.append(form, _.input);
util.append(top, form);
Expand Down Expand Up @@ -421,9 +411,7 @@
items = !!_.searching ? _.searchData.length : _.rows.length;
}

var string = _.options.labels.info.replace("{page}", f).replace("{current}", t).replace("{pages}", items);

_.label.innerHTML = items ? string : "";
_.label.innerHTML = ['Showing ', f, ' to ', t, ' of ', items, ' rows'].join('');

if (_.options.fixedHeight && _.currentPage == 1) {
fixHeight.call(_);
Expand Down Expand Up @@ -660,24 +648,12 @@
nextText: '›',
firstText: '«',
lastText: '»',

sortable: true,

searchable: true,
fixedColumns: true,
fixedHeight: false,

truncatePager: true,
pagerDelta: 2,

searchable: true,

// Customise the display text
labels: {
placeholder: "Search...", // The search input placeholder
perPage: "{select} entries per page", // per-page dropdown label
noRows: "No entries to found", // Message shown when there are no search results
info: "Showing {page} to {current} of {pages} entries", //
}
pagerDelta: 2
};

// user options
Expand Down Expand Up @@ -790,7 +766,7 @@
});

if (!_.searchData.length) {
_.setMessage(_.options.labels.noRows);
_.setMessage('No rows found.');
}

_.update();
Expand Down Expand Up @@ -945,7 +921,7 @@
};

DataTable.prototype.setMessage = function(message) {
var colspan = this.rows[0].cells.length;
var colspan = this.table.tBodies[0].rows[0].cells.length;
this.clear(util.createElement('tr', {
html: '<td class="dataTables-empty" colspan="' + colspan + '">' + message + '</td>'
}));
Expand Down
Loading

0 comments on commit f3fe442

Please sign in to comment.