Skip to content

Commit ada3cee

Browse files
committed
Solved issue #69
1 parent bb47821 commit ada3cee

17 files changed

+40
-29
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ src/*.map
66
*~
77
*.diff
88
*.patch
9-
.DS_Store
9+
.DS_Store
10+
settings.json

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.3.1
4+
5+
### Enhancements & Features
6+
- Replaced href attributes in order to prevent hash tags so *angular JS* works proper; see issue [#69](http://github.com/rstaib/jquery-bootgrid/issues/69) for more details
7+
8+
### Breaking Changes
9+
There are no breaking changes but some HTML templates changed during development. In case you want to use the full new feature set be sure you did not override any affected (actionDropDownItem and paginationItem) templates.
10+
311
## 1.3.0
412

513
### Enhancements & Features

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"accessibility",
1414
"bootstrap"
1515
],
16-
"version": "1.3.0",
16+
"version": "1.3.1",
1717
"authors": [
1818
{
1919
"name": "Rafael Staib",

demo/index.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
return "<a href=\"#\">" + column.id + ": " + row.id + "</a>";
190190
}
191191
},
192-
rowCount: [-1, 25, 50, 75]
192+
rowCount: [-1, 10, 50, 75]
193193
});
194194
}
195195

dist/jQuery.Bootgrid.1.3.0.nupkg

-26.9 KB
Binary file not shown.

dist/jQuery.Bootgrid.1.3.1.nupkg

26.9 KB
Binary file not shown.

dist/jquery.bootgrid-1.3.0.zip

-28.8 KB
Binary file not shown.

dist/jquery.bootgrid-1.3.1.zip

28.8 KB
Binary file not shown.

dist/jquery.bootgrid.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bootgrid v1.3.0 - 09/04/2015
2+
* jQuery Bootgrid v1.3.1 - 09/11/2015
33
* Copyright (c) 2014-2015 Rafael Staib (http://www.jquery-bootgrid.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/

dist/jquery.bootgrid.fa.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bootgrid v1.3.0 - 09/04/2015
2+
* jQuery Bootgrid v1.3.1 - 09/11/2015
33
* Copyright (c) 2014-2015 Rafael Staib (http://www.jquery-bootgrid.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/

dist/jquery.bootgrid.fa.min.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bootgrid v1.3.0 - 09/04/2015
2+
* jQuery Bootgrid v1.3.1 - 09/11/2015
33
* Copyright (c) 2014-2015 Rafael Staib (http://www.jquery-bootgrid.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/

dist/jquery.bootgrid.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery Bootgrid v1.3.0 - 09/04/2015
2+
* jQuery Bootgrid v1.3.1 - 09/11/2015
33
* Copyright (c) 2014-2015 Rafael Staib (http://www.jquery-bootgrid.com)
44
* Licensed under MIT http://www.opensource.org/licenses/MIT
55
*/
@@ -495,16 +495,17 @@
495495
}
496496
}
497497

498-
function renderPaginationItem(list, uri, text, markerCss)
498+
function renderPaginationItem(list, page, text, markerCss)
499499
{
500500
var that = this,
501501
tpl = this.options.templates,
502502
css = this.options.css,
503-
values = getParams.call(this, { css: markerCss, text: text, uri: "#" + uri }),
503+
values = getParams.call(this, { css: markerCss, text: text, page: page }),
504504
item = $(tpl.paginationItem.resolve(values))
505505
.on("click" + namespace, getCssSelector(css.paginationButton), function (e)
506506
{
507507
e.stopPropagation();
508+
e.preventDefault();
508509

509510
var $this = $(this),
510511
parent = $this.parent();
@@ -516,8 +517,8 @@
516517
next: that.current + 1,
517518
last: that.totalPages
518519
};
519-
var command = $this.attr("href").substr(1);
520-
that.current = commandList[command] || +command; // + converts string to int
520+
var command = $this.data("page");
521+
that.current = commandList[command] || command;
521522
loadData.call(that);
522523
}
523524
$this.trigger("blur");
@@ -550,14 +551,14 @@
550551
$.each(rowCountList, function (index, value)
551552
{
552553
var item = $(tpl.actionDropDownItem.resolve(getParams.call(that,
553-
{ text: getText(value), uri: "#" + value })))
554+
{ text: getText(value), action: value })))
554555
._bgSelectAria(value === that.rowCount)
555556
.on("click" + namespace, menuItemSelector, function (e)
556557
{
557558
e.preventDefault();
558559

559560
var $this = $(this),
560-
newRowCount = +$this.attr("href").substr(1);
561+
newRowCount = $this.data("action");
561562
if (newRowCount !== that.rowCount)
562563
{
563564
// todo: sophisticated solution needed for calculating which page is selected
@@ -566,7 +567,7 @@
566567
$this.parents(menuItemsSelector).children().each(function ()
567568
{
568569
var $item = $(this),
569-
currentRowCount = +$item.find(menuItemSelector).attr("href").substr(1);
570+
currentRowCount = $item.find(menuItemSelector).data("action");
570571
$item._bgSelectAria(currentRowCount === newRowCount);
571572
});
572573
$this.parents(menuSelector).find(menuTextSelector).text(getText(newRowCount));
@@ -1355,7 +1356,7 @@
13551356
templates: {
13561357
actionButton: "<button class=\"btn btn-default\" type=\"button\" title=\"{{ctx.text}}\">{{ctx.content}}</button>",
13571358
actionDropDown: "<div class=\"{{css.dropDownMenu}}\"><button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"><span class=\"{{css.dropDownMenuText}}\">{{ctx.content}}</span> <span class=\"caret\"></span></button><ul class=\"{{css.dropDownMenuItems}}\" role=\"menu\"></ul></div>",
1358-
actionDropDownItem: "<li><a href=\"{{ctx.uri}}\" class=\"{{css.dropDownItem}} {{css.dropDownItemButton}}\">{{ctx.text}}</a></li>",
1359+
actionDropDownItem: "<li><a data-action=\"{{ctx.action}}\" class=\"{{css.dropDownItem}} {{css.dropDownItemButton}}\">{{ctx.text}}</a></li>",
13591360
actionDropDownCheckboxItem: "<li><label class=\"{{css.dropDownItem}}\"><input name=\"{{ctx.name}}\" type=\"checkbox\" value=\"1\" class=\"{{css.dropDownItemCheckbox}}\" {{ctx.checked}} /> {{ctx.label}}</label></li>",
13601361
actions: "<div class=\"{{css.actions}}\"></div>",
13611362
body: "<tbody></tbody>",
@@ -1368,7 +1369,7 @@
13681369
loading: "<tr><td colspan=\"{{ctx.columns}}\" class=\"loading\">{{lbl.loading}}</td></tr>",
13691370
noResults: "<tr><td colspan=\"{{ctx.columns}}\" class=\"no-results\">{{lbl.noResults}}</td></tr>",
13701371
pagination: "<ul class=\"{{css.pagination}}\"></ul>",
1371-
paginationItem: "<li class=\"{{ctx.css}}\"><a href=\"{{ctx.uri}}\" class=\"{{css.paginationButton}}\">{{ctx.text}}</a></li>",
1372+
paginationItem: "<li class=\"{{ctx.css}}\"><a data-page=\"{{ctx.page}}\" class=\"{{css.paginationButton}}\">{{ctx.text}}</a></li>",
13721373
rawHeaderCell: "<th class=\"{{ctx.css}}\">{{ctx.content}}</th>", // Used for the multi select box
13731374
row: "<tr{{ctx.attr}}>{{ctx.cells}}</tr>",
13741375
search: "<div class=\"{{css.search}}\"><div class=\"input-group\"><span class=\"{{css.icon}} input-group-addon {{css.iconSearch}}\"></span> <input type=\"text\" class=\"{{css.searchField}}\" placeholder=\"{{lbl.search}}\" /></div></div>",

dist/jquery.bootgrid.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.bootgrid.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "jquery-bootgrid",
33
"namespace": "jquery.bootgrid",
44
"title": "jQuery Bootgrid",
5-
"version": "1.3.0",
5+
"version": "1.3.1",
66
"description": "Nice, sleek and intuitive. A grid control especially designed for bootstrap.",
77
"homepage": "http://www.jquery-bootgrid.com",
88
"author": {

src/internal.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -485,16 +485,17 @@ function renderPagination()
485485
}
486486
}
487487

488-
function renderPaginationItem(list, uri, text, markerCss)
488+
function renderPaginationItem(list, page, text, markerCss)
489489
{
490490
var that = this,
491491
tpl = this.options.templates,
492492
css = this.options.css,
493-
values = getParams.call(this, { css: markerCss, text: text, uri: "#" + uri }),
493+
values = getParams.call(this, { css: markerCss, text: text, page: page }),
494494
item = $(tpl.paginationItem.resolve(values))
495495
.on("click" + namespace, getCssSelector(css.paginationButton), function (e)
496496
{
497497
e.stopPropagation();
498+
e.preventDefault();
498499

499500
var $this = $(this),
500501
parent = $this.parent();
@@ -506,8 +507,8 @@ function renderPaginationItem(list, uri, text, markerCss)
506507
next: that.current + 1,
507508
last: that.totalPages
508509
};
509-
var command = $this.attr("href").substr(1);
510-
that.current = commandList[command] || +command; // + converts string to int
510+
var command = $this.data("page");
511+
that.current = commandList[command] || command;
511512
loadData.call(that);
512513
}
513514
$this.trigger("blur");
@@ -540,14 +541,14 @@ function renderRowCountSelection(actions)
540541
$.each(rowCountList, function (index, value)
541542
{
542543
var item = $(tpl.actionDropDownItem.resolve(getParams.call(that,
543-
{ text: getText(value), uri: "#" + value })))
544+
{ text: getText(value), action: value })))
544545
._bgSelectAria(value === that.rowCount)
545546
.on("click" + namespace, menuItemSelector, function (e)
546547
{
547548
e.preventDefault();
548549

549550
var $this = $(this),
550-
newRowCount = +$this.attr("href").substr(1);
551+
newRowCount = $this.data("action");
551552
if (newRowCount !== that.rowCount)
552553
{
553554
// todo: sophisticated solution needed for calculating which page is selected
@@ -556,7 +557,7 @@ function renderRowCountSelection(actions)
556557
$this.parents(menuItemsSelector).children().each(function ()
557558
{
558559
var $item = $(this),
559-
currentRowCount = +$item.find(menuItemSelector).attr("href").substr(1);
560+
currentRowCount = $item.find(menuItemSelector).data("action");
560561
$item._bgSelectAria(currentRowCount === newRowCount);
561562
});
562563
$this.parents(menuSelector).find(menuTextSelector).text(getText(newRowCount));

src/public.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ Grid.defaults = {
397397
templates: {
398398
actionButton: "<button class=\"btn btn-default\" type=\"button\" title=\"{{ctx.text}}\">{{ctx.content}}</button>",
399399
actionDropDown: "<div class=\"{{css.dropDownMenu}}\"><button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\"><span class=\"{{css.dropDownMenuText}}\">{{ctx.content}}</span> <span class=\"caret\"></span></button><ul class=\"{{css.dropDownMenuItems}}\" role=\"menu\"></ul></div>",
400-
actionDropDownItem: "<li><a href=\"{{ctx.uri}}\" class=\"{{css.dropDownItem}} {{css.dropDownItemButton}}\">{{ctx.text}}</a></li>",
400+
actionDropDownItem: "<li><a data-action=\"{{ctx.action}}\" class=\"{{css.dropDownItem}} {{css.dropDownItemButton}}\">{{ctx.text}}</a></li>",
401401
actionDropDownCheckboxItem: "<li><label class=\"{{css.dropDownItem}}\"><input name=\"{{ctx.name}}\" type=\"checkbox\" value=\"1\" class=\"{{css.dropDownItemCheckbox}}\" {{ctx.checked}} /> {{ctx.label}}</label></li>",
402402
actions: "<div class=\"{{css.actions}}\"></div>",
403403
body: "<tbody></tbody>",
@@ -410,7 +410,7 @@ Grid.defaults = {
410410
loading: "<tr><td colspan=\"{{ctx.columns}}\" class=\"loading\">{{lbl.loading}}</td></tr>",
411411
noResults: "<tr><td colspan=\"{{ctx.columns}}\" class=\"no-results\">{{lbl.noResults}}</td></tr>",
412412
pagination: "<ul class=\"{{css.pagination}}\"></ul>",
413-
paginationItem: "<li class=\"{{ctx.css}}\"><a href=\"{{ctx.uri}}\" class=\"{{css.paginationButton}}\">{{ctx.text}}</a></li>",
413+
paginationItem: "<li class=\"{{ctx.css}}\"><a data-page=\"{{ctx.page}}\" class=\"{{css.paginationButton}}\">{{ctx.text}}</a></li>",
414414
rawHeaderCell: "<th class=\"{{ctx.css}}\">{{ctx.content}}</th>", // Used for the multi select box
415415
row: "<tr{{ctx.attr}}>{{ctx.cells}}</tr>",
416416
search: "<div class=\"{{css.search}}\"><div class=\"input-group\"><span class=\"{{css.icon}} input-group-addon {{css.iconSearch}}\"></span> <input type=\"text\" class=\"{{css.searchField}}\" placeholder=\"{{lbl.search}}\" /></div></div>",

0 commit comments

Comments
 (0)