Authored by xuhongyun

Merge branch 'dev_上下架弹窗优化' into grey

... ... @@ -83,8 +83,9 @@ toast.prototype.init = function(options) {
});
}
__self.dom.wrap.on('click', '[data-id]', function(event) {
// mod by xueyin: 修改事件实现
// __self.dom.wrap.on('click', '[data-id]', function(event) {
__self.dom.wrap.find('.modal-content').on('click', '[data-id]', function(event) {
var $this = $(this);
if (!$this.attr('disabled')) {
__self._trigger($this.data('id'));
... ... @@ -92,6 +93,17 @@ toast.prototype.init = function(options) {
event.preventDefault();
});
// mod by xueyin: 对话框上的事件不需要冒泡
$(document).on('click', '.modal-content', function(event) {
event.stopPropagation();
});
// add by xueyin: 增加点击背影关闭对话框功能
if (_o.backdrop == true) {
$(document).on('click', '.modal', function(event) {
__self.close();
});
}
return __self;
};
toast.prototype.addclass = function(css) {
... ... @@ -160,9 +172,11 @@ toast.prototype.time = function(second) {
};
toast.prototype.zIndex = function () {
var __self = this, _o = __self.options;
var index = _o.zIndex++;
__self.dom.wrap.css('zIndex', index);
__self.dom.backdrop.css('zIndex', index - 1);
// mod by xueyin 修改zindex,将对话框放到最上层
var index = _o.zIndex + 2;
__self.dom.wrap.find('.modal-content').css('zIndex', index);
__self.dom.wrap.css('zIndex', index - 1);
__self.dom.backdrop.css('zIndex', index - 2);
_o.zIndex = index;
return __self;
};
... ... @@ -181,6 +195,13 @@ toast.prototype.close = function() {
var __self = this,
_o = __self.options;
// add by xueyin: 关闭所注册过的事件
$(document).off('click', '.modal-content');
if (_o.backdrop == true) {
$(document).off('click', '.modal');
}
if (!__self.destroyed && __self.open) {
__self.dom.wrap.removeClass('in');
setTimeout(function() {
... ... @@ -248,12 +269,14 @@ toast._through = function() {
return api;
};
toast.open = function(options, callback) {
return this._through({
title: options.title,
addClass: options.addClass,
width: options.width,
content: options.content
});
// mod by xueyin: 这个参数传递很奇怪,不全,修改之
// return this._through({
// title: options.title,
// addClass: options.addClass,
// width: options.width,
// content: options.content
// });
return this._through(options);
}
toast.alert = function(content, callback) {
var __self = this,
... ...
... ... @@ -243,8 +243,9 @@ var g = new common.grid({
} else if (item.middleSortName) {
catgory = item.middleSortName;
};
html.push('<p>名称:<a target="_blank" data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '/' + item.isAuditing + '" class="btn btn-info btn-xs edit-class-btn">' + item.productName + '</a>');
// mod by xueyin: 优化,商品名称去掉链接,支持业务复制
//html.push('<p>名称:<a target="_blank" data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '/' + item.isAuditing + '" class="btn btn-info btn-xs edit-class-btn">' + item.productName + '</a>');
html.push("<p>名称:" + item.productName + "</p>");
html.push("<p>品牌:" + item.brandName + "</p>");
html.push("<p>品类:" + catgory + "</p>");
return html.join('');
... ... @@ -449,6 +450,10 @@ var g = new common.grid({
display: "操作",
render: function(item) {
var html = [];
// add by xueyin: 仍然保留详情页链接
html.push('<a target="_blank" data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '/' + item.isAuditing + '" class="btn btn-info btn-xs edit-class-btn">查看</a>');
if (item.isAuditing != 100) {
html.push('<a target="_blank" data-index="' + item.__index + '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/' + item.productSkn + '/' + item.isAuditing + '">修改</a>');
}
... ...
... ... @@ -605,7 +605,10 @@ $('#basicTable').on('click', '.shelve-btn', function () {
shelveLayer = common.dialog.open({
title: '上/下架',
width: 900,
content: common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct)
content: common.util.__template($('#template').html(), res.data.baseProductInfo.baseProduct),
// add by xueyin: 增加支持点击背影关闭对话框功能
backdrop: true
});
$(that).removeClass('disabled');
... ...