[增加]form增加data-search行为处理

This commit is contained in:
邹景立 2017-03-29 18:28:23 +08:00
parent cc30c1a713
commit 93f97cd78e

View File

@ -30,6 +30,16 @@ define(['jquery', 'admin.plugs'], function () {
return _goLoad.call(this);
});
/*! 注册 data-serach 表单搜索行为 */
this.$body.on('submit', 'form[data-serach]', function () {
var split = this.action.indexOf('?') === -1 ? '?' : '&';
if ((this.method || 'get').toLowerCase() === 'get') {
window.location.href = '#' + parseUri(this.action + split + $(this).serialize());
} else {
$.form.load(this.action, this, 'post');
}
});
/*! 注册 data-modal 事件行为 */
this.$body.on('click', '[data-modal]', function () {
return $.form.modal($(this).attr('data-modal'), 'open_type=modal', $(this).attr('data-title') || '编辑');