refactor: bootstrap-toggle 移动设备支持代码优化
This commit is contained in:
parent
8b5b79908c
commit
1389f386d4
|
@ -517,6 +517,10 @@
|
|||
var defaultVal = this.$element.attr('data-default-val') || '';
|
||||
if (defaultVal === '') this.$element.prop('checked', true);
|
||||
oldFunc.call(this);
|
||||
this.$toggle.on('touchend', function (e) {
|
||||
$(this).trigger('click.bs.toggle');
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -574,11 +578,5 @@
|
|||
$('.date').lgbDatePicker().on('show hide', function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// 移动设备支持 bootstrap-toggle 扩展
|
||||
$('[data-toggle="toggle"]').on('touchend', function (e) {
|
||||
$(this).trigger('click.bs.toggle');
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
Loading…
Reference in New Issue