Skip to content

Commit

Permalink
fix bug #78
Browse files Browse the repository at this point in the history
  • Loading branch information
唐斌 committed Oct 5, 2014
1 parent 132c1f4 commit dcc2989
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 47 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ artDialog v6 —— 经典的网页对话框组件,内外皆用心雕琢。

## 更新历史

6.0.3

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

6.0.2

1. 提供无依赖 seajs 与 requirejs 的版本
Expand Down
2 changes: 1 addition & 1 deletion dist/dialog-min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dialog-plus-min.js

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions dist/dialog-plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ if (css) {


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


// 按钮组点击
$popup.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});


// 点击遮罩自动关闭对话框
if (options.quickClose) {
$(this.backdrop).on(
Expand Down Expand Up @@ -1174,6 +1163,7 @@ $.extend(prototype, {

if (typeof args === 'string') {
html = args;
number ++;
} else {
$.each(args, function (i, val) {

Expand Down Expand Up @@ -1203,8 +1193,18 @@ $.extend(prototype, {
}

this._$('footer')[number ? 'show' : 'hide']();
this._$('button').html(html);

this._$('button')
.html(html)
.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});

return this;
},

Expand Down Expand Up @@ -1596,7 +1596,7 @@ dialog.oncreate = function (api) {
for (var i = 0; i < frames.length; i ++) {
try {
if (originalOptions instanceof frames[i].Object) {
// 让 iframe 刷新前时候也关闭对话框
// 让 iframe 刷新的时候也关闭对话框
// 防止要执行的对象被强制收回导致 IE 报错:“不能执行已释放 Script 的代码”
$(frames[i]).one('unload', un);
break;
Expand Down
26 changes: 13 additions & 13 deletions dist/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ if (css) {


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


// 按钮组点击
$popup.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});


// 点击遮罩自动关闭对话框
if (options.quickClose) {
$(this.backdrop).on(
Expand Down Expand Up @@ -1174,6 +1163,7 @@ $.extend(prototype, {

if (typeof args === 'string') {
html = args;
number ++;
} else {
$.each(args, function (i, val) {

Expand Down Expand Up @@ -1203,8 +1193,18 @@ $.extend(prototype, {
}

this._$('footer')[number ? 'show' : 'hide']();
this._$('button').html(html);

this._$('button')
.html(html)
.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});

return this;
},

Expand Down
4 changes: 2 additions & 2 deletions doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ <h3><span id="other-skin">自定义样式</span></h3>

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

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

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

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

<hr />

<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>
<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>

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

Expand Down
4 changes: 2 additions & 2 deletions doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ d.show();

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

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

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

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

=======================

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

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artDialog",
"version": "6.0.2",
"version": "6.0.3",
"readmeFilename": "README.md",
"description": "经典的网页对话框组件,内外皆用心雕琢",
"homepage": "https://github.com/aui/artDialog",
Expand Down
26 changes: 13 additions & 13 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (css) {


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


// 按钮组点击
$popup.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});


// 点击遮罩自动关闭对话框
if (options.quickClose) {
$(this.backdrop).on(
Expand Down Expand Up @@ -379,6 +368,7 @@ $.extend(prototype, {

if (typeof args === 'string') {
html = args;
number ++;
} else {
$.each(args, function (i, val) {

Expand Down Expand Up @@ -408,8 +398,18 @@ $.extend(prototype, {
}

this._$('footer')[number ? 'show' : 'hide']();
this._$('button').html(html);

this._$('button')
.html(html)
.on('click', '[data-id]', function (event) {
var $this = $(this);
if (!$this.attr('disabled')) {// IE BUG
that._trigger($this.data('id'));
}

event.preventDefault();
});

return this;
},

Expand Down

0 comments on commit dcc2989

Please sign in to comment.