Skip to content

Commit 1063ba4

Browse files
committed
Filter out back/forward button presses
1 parent b19b6ed commit 1063ba4

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

Griddly/Scripts/griddly.js

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -687,28 +687,31 @@
687687

688688
$(this.$element).on("mouseup", "tbody.data tr td:not(:has(input))", $.proxy(function (e)
689689
{
690-
var url = $.trim($(e.target).parents("tr").data("griddly-url"));
691-
var target = $.trim($(e.target).parents("tr").data("griddly-urltarget"));
692-
693-
if (url && $(e.target).closest("a").length == 0 && $(e.target).closest("td").find("[data-toggle=dropdown]").length == 0)
690+
if (e.which < 3)
694691
{
695-
if (this.options.rowClickModal)
692+
var url = $.trim($(e.target).parents("tr").data("griddly-url"));
693+
var target = $.trim($(e.target).parents("tr").data("griddly-urltarget"));
694+
695+
if (url && $(e.target).closest("a").length == 0 && $(e.target).closest("td").find("[data-toggle=dropdown]").length == 0)
696696
{
697-
$(this.options.rowClickModal).removeData("bs.modal").modal({ show: false });
698-
$(".modal-content", this.options.rowClickModal).load($.trim(url), $.proxy(function (event)
697+
if (this.options.rowClickModal)
699698
{
700-
$(this.options.rowClickModal).modal("show");
701-
}, this));
702-
}
703-
else
704-
{
705-
if (e.which == 2 || e.ctrlKey || target == "_blank")
706-
window.open(url);
707-
else if (e.which != 3)
708-
window.location = url;
709-
}
699+
$(this.options.rowClickModal).removeData("bs.modal").modal({ show: false });
700+
$(".modal-content", this.options.rowClickModal).load($.trim(url), $.proxy(function (event)
701+
{
702+
$(this.options.rowClickModal).modal("show");
703+
}, this));
704+
}
705+
else
706+
{
707+
if (e.which == 2 || e.ctrlKey || target == "_blank")
708+
window.open(url);
709+
else
710+
window.location = url;
711+
}
710712

711-
e.preventDefault();
713+
e.preventDefault();
714+
}
712715
}
713716
}, this));
714717

0 commit comments

Comments
 (0)