Skip to content

Commit 6901981

Browse files
committed
Generalize selected row display
1 parent fc42bca commit 6901981

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Griddly/Scripts/griddly.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,28 @@
9999

100100
this.setSelectedCount = $.proxy(function ()
101101
{
102-
$("thead tr td span .griddly-selection-count", this.$element).text(Object.keys(this.options.selectedRows).length);
102+
$(".griddly-selection-count", this.$element).text(Object.keys(this.options.selectedRows).length);
103103

104104
if (!$.isEmptyObject(this.options.selectedRows))
105105
{
106-
this.$element.find("span.griddly-selection:not(:visible)").animate({ width: "show" }, 350);
106+
var el = this.$element.find(".griddly-selection:not(:visible)");
107+
108+
if (el.is("span"))
109+
el.animate({ width: "show" }, 350);
110+
else
111+
el.show(350);
112+
107113
$(this.$element).find("[data-enable-on-selection=true]").removeClass("disabled");
108114
}
109115
else
110116
{
111-
this.$element.find("span.griddly-selection:visible").animate({ width: "hide" }, 350);
117+
var el = this.$element.find(".griddly-selection:visible");
118+
119+
if (el.is("span"))
120+
el.animate({ width: "hide" }, 350);
121+
else
122+
el.hide(350);
123+
112124
$(this.$element).find("[data-enable-on-selection=true]").addClass("disabled");
113125
}
114126

@@ -431,7 +443,7 @@
431443
this.$element.find("input[name=_rowselect]").prop("checked", true).each(function () { setRowSelect($(this)); });
432444
}, this));
433445

434-
$(this.$element).on("click", "thead tr .griddly-selection-clear", $.proxy(function (event)
446+
$(this.$element).on("click", ".griddly-selection-clear", $.proxy(function (event)
435447
{
436448
this.clearSelected();
437449
}, this));
@@ -1305,7 +1317,7 @@
13051317
}
13061318
};
13071319

1308-
// $("[data-role=griddly]").griddly();
1320+
$("[data-role=griddly]").griddly();
13091321

13101322
$(function ()
13111323
{

0 commit comments

Comments
 (0)