Skip to content

Commit dcc2989

Browse files
author
唐斌
committed
fix bug #78
1 parent 132c1f4 commit dcc2989

9 files changed

+52
-47
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ artDialog v6 —— 经典的网页对话框组件,内外皆用心雕琢。
2020

2121
## 更新历史
2222

23+
6.0.3
24+
25+
1. 修复``button``方法直接传入 html 不显示的问题
26+
2. 修复版本管理导致[#78](https://github.com/aui/artDialog/issues/78)重现问题
27+
2328
6.0.2
2429

2530
1. 提供无依赖 seajs 与 requirejs 的版本

dist/dialog-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dialog-plus-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dialog-plus.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ if (css) {
826826

827827

828828
var _count = 0;
829-
var _expando = new Date() - 0; // Data.now()
829+
var _expando = new Date() - 0; // Date.now()
830830
var _isIE6 = !('minWidth' in $('html')[0].style);
831831
var _isMobile = 'createTouch' in document && !('onmousemove' in document)
832832
|| /(iPhone|iPad|iPod)/i.test(navigator.userAgent);
@@ -965,17 +965,6 @@ artDialog.create = function (options) {
965965
this._$('body').css('padding', this.padding);
966966

967967

968-
// 按钮组点击
969-
$popup.on('click', '[data-id]', function (event) {
970-
var $this = $(this);
971-
if (!$this.attr('disabled')) {// IE BUG
972-
that._trigger($this.data('id'));
973-
}
974-
975-
event.preventDefault();
976-
});
977-
978-
979968
// 点击遮罩自动关闭对话框
980969
if (options.quickClose) {
981970
$(this.backdrop).on(
@@ -1174,6 +1163,7 @@ $.extend(prototype, {
11741163

11751164
if (typeof args === 'string') {
11761165
html = args;
1166+
number ++;
11771167
} else {
11781168
$.each(args, function (i, val) {
11791169

@@ -1203,8 +1193,18 @@ $.extend(prototype, {
12031193
}
12041194

12051195
this._$('footer')[number ? 'show' : 'hide']();
1206-
this._$('button').html(html);
1196+
1197+
this._$('button')
1198+
.html(html)
1199+
.on('click', '[data-id]', function (event) {
1200+
var $this = $(this);
1201+
if (!$this.attr('disabled')) {// IE BUG
1202+
that._trigger($this.data('id'));
1203+
}
12071204

1205+
event.preventDefault();
1206+
});
1207+
12081208
return this;
12091209
},
12101210

@@ -1596,7 +1596,7 @@ dialog.oncreate = function (api) {
15961596
for (var i = 0; i < frames.length; i ++) {
15971597
try {
15981598
if (originalOptions instanceof frames[i].Object) {
1599-
// 让 iframe 刷新前时候也关闭对话框
1599+
// 让 iframe 刷新的时候也关闭对话框
16001600
// 防止要执行的对象被强制收回导致 IE 报错:“不能执行已释放 Script 的代码”
16011601
$(frames[i]).one('unload', un);
16021602
break;

dist/dialog.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ if (css) {
826826

827827

828828
var _count = 0;
829-
var _expando = new Date() - 0; // Data.now()
829+
var _expando = new Date() - 0; // Date.now()
830830
var _isIE6 = !('minWidth' in $('html')[0].style);
831831
var _isMobile = 'createTouch' in document && !('onmousemove' in document)
832832
|| /(iPhone|iPad|iPod)/i.test(navigator.userAgent);
@@ -965,17 +965,6 @@ artDialog.create = function (options) {
965965
this._$('body').css('padding', this.padding);
966966

967967

968-
// 按钮组点击
969-
$popup.on('click', '[data-id]', function (event) {
970-
var $this = $(this);
971-
if (!$this.attr('disabled')) {// IE BUG
972-
that._trigger($this.data('id'));
973-
}
974-
975-
event.preventDefault();
976-
});
977-
978-
979968
// 点击遮罩自动关闭对话框
980969
if (options.quickClose) {
981970
$(this.backdrop).on(
@@ -1174,6 +1163,7 @@ $.extend(prototype, {
11741163

11751164
if (typeof args === 'string') {
11761165
html = args;
1166+
number ++;
11771167
} else {
11781168
$.each(args, function (i, val) {
11791169

@@ -1203,8 +1193,18 @@ $.extend(prototype, {
12031193
}
12041194

12051195
this._$('footer')[number ? 'show' : 'hide']();
1206-
this._$('button').html(html);
1196+
1197+
this._$('button')
1198+
.html(html)
1199+
.on('click', '[data-id]', function (event) {
1200+
var $this = $(this);
1201+
if (!$this.attr('disabled')) {// IE BUG
1202+
that._trigger($this.data('id'));
1203+
}
12071204

1205+
event.preventDefault();
1206+
});
1207+
12081208
return this;
12091209
},
12101210

doc/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ <h3><span id="other-skin">自定义样式</span></h3>
12821282

12831283
<h3><span id="other-grunt">源码构建</span></h3>
12841284

1285-
<p>使用<a href="http://gruntjs.cn">GruntJS</a>在 artDialog 源码根目录执行即可。</p>
1285+
<p>使用 <a href="http://gruntjs.cn">GruntJS</a> 在 artDialog 源码根目录执行即可。</p>
12861286

12871287
<h3><span id="other-upgrade">artDialog v5 升级 v6 参考</span></h3>
12881288

@@ -1294,7 +1294,7 @@ <h3><span id="other-support">支持</span></h3>
12941294

12951295
<hr />
12961296

1297-
<p>如果你喜欢 artDialog,请<a href="https://me.alipay.com/planeart">捐赠</a>一杯咖啡的费用以支持 artDialog。如果您认为 LGPL 开源协议满足不了您的项目,亦可购买<a href="https://github.com/aui/artDialog/blob/master/LICENSE.md">商业授权</a></p>
1297+
<p>如果你喜欢 artDialog,请 <a href="https://me.alipay.com/planeart">捐赠</a> 一杯咖啡的费用以支持 artDialog。如果您认为 LGPL 开源协议满足不了您的项目,亦可购买 <a href="https://github.com/aui/artDialog/blob/master/LICENSE.md">商业授权</a></p>
12981298

12991299
<script src="../lib/jquery-1.10.2.js"></script>
13001300

doc/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ d.show();
10051005

10061006
### [源码构建](id:other-grunt)
10071007

1008-
使用[GruntJS](http://gruntjs.cn)在 artDialog 源码根目录执行即可。
1008+
使用 [GruntJS](http://gruntjs.cn) 在 artDialog 源码根目录执行即可。
10091009

10101010
### [artDialog v5 升级 v6 参考](id:other-upgrade)
10111011

@@ -1017,7 +1017,7 @@ artDialog 是基于 [LGPL](https://github.com/aui/artDialog/blob/master/LICENSE.
10171017

10181018
=======================
10191019

1020-
如果你喜欢 artDialog,请[捐赠](https://me.alipay.com/planeart)一杯咖啡的费用以支持 artDialog。如果您认为 LGPL 开源协议满足不了您的项目,亦可购买[商业授权](https://github.com/aui/artDialog/blob/master/LICENSE.md)
1020+
如果你喜欢 artDialog,请 [捐赠](https://me.alipay.com/planeart) 一杯咖啡的费用以支持 artDialog。如果您认为 LGPL 开源协议满足不了您的项目,亦可购买 [商业授权](https://github.com/aui/artDialog/blob/master/LICENSE.md)
10211021

10221022
<script src="../lib/jquery-1.10.2.js"></script>
10231023

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "artDialog",
3-
"version": "6.0.2",
3+
"version": "6.0.3",
44
"readmeFilename": "README.md",
55
"description": "经典的网页对话框组件,内外皆用心雕琢",
66
"homepage": "https://github.com/aui/artDialog",

src/dialog.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if (css) {
3131

3232

3333
var _count = 0;
34-
var _expando = new Date() - 0; // Data.now()
34+
var _expando = new Date() - 0; // Date.now()
3535
var _isIE6 = !('minWidth' in $('html')[0].style);
3636
var _isMobile = 'createTouch' in document && !('onmousemove' in document)
3737
|| /(iPhone|iPad|iPod)/i.test(navigator.userAgent);
@@ -170,17 +170,6 @@ artDialog.create = function (options) {
170170
this._$('body').css('padding', this.padding);
171171

172172

173-
// 按钮组点击
174-
$popup.on('click', '[data-id]', function (event) {
175-
var $this = $(this);
176-
if (!$this.attr('disabled')) {// IE BUG
177-
that._trigger($this.data('id'));
178-
}
179-
180-
event.preventDefault();
181-
});
182-
183-
184173
// 点击遮罩自动关闭对话框
185174
if (options.quickClose) {
186175
$(this.backdrop).on(
@@ -379,6 +368,7 @@ $.extend(prototype, {
379368

380369
if (typeof args === 'string') {
381370
html = args;
371+
number ++;
382372
} else {
383373
$.each(args, function (i, val) {
384374

@@ -408,8 +398,18 @@ $.extend(prototype, {
408398
}
409399

410400
this._$('footer')[number ? 'show' : 'hide']();
411-
this._$('button').html(html);
401+
402+
this._$('button')
403+
.html(html)
404+
.on('click', '[data-id]', function (event) {
405+
var $this = $(this);
406+
if (!$this.attr('disabled')) {// IE BUG
407+
that._trigger($this.data('id'));
408+
}
412409

410+
event.preventDefault();
411+
});
412+
413413
return this;
414414
},
415415

0 commit comments

Comments
 (0)