修改BUG:移动端页面点击工具栏按钮后导致页面自动回滚到页面顶端

This commit is contained in:
Argo-Lenovo 2017-01-02 12:46:30 +08:00
parent 0ace1c64a3
commit 54f5145b37
2 changed files with 4 additions and 2 deletions

View File

@ -312,7 +312,8 @@
}, options);
$(this).bootstrapTable(settings);
var $toolbar = $('div.toolbar');
$toolbar.on('click', 'a', function () {
$toolbar.on('click', 'a', function (e) {
e.preventDefault();
var ctl = $('#' + $(this).attr('id').replace('tb_', 'btn_'));
ctl.trigger("click");
}).insertBefore($('div.bootstrap-table > div.fixed-table-toolbar > div.bs-bars'));

View File

@ -45,7 +45,8 @@
var source = $("#" + cId);
source.data('click', name);
if (event !== null) source.data('event', event);
source.click(function () {
source.click(function (e) {
e.preventDefault();
var method = source.data('click');
BootstrapAdmin.prototype[method].call(that, this, source.data('event'));
});