Skip to content

Commit

Permalink
Merge pull request #97 from luolonghao/master
Browse files Browse the repository at this point in the history
improve [data-role=close] selector
  • Loading branch information
afc163 committed May 20, 2015
2 parents e700551 + 255cc82 commit e695da4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ new Dialog({

<button id="example2">内容传入DOM 对象</button>

<div class="fn-hide"><div id="example2-dom" style="padding:50px">传入了DOM</div></div>
<div class="fn-hide"><div id="example2-dom" style="padding:50px">传入了DOM,<button type="button" data-role="close">关闭</button></div></div>


````javascript
Expand Down
6 changes: 3 additions & 3 deletions src/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ var Dialog = Overlay.extend({
// 这样写是为了回避 arale.base 的一个问题:
// 当属性初始值为''时,不会进入 onRender 方法
// https://github.com/aralejs/base/issues/7
this.$('[data-role=close]').hide();
this.$('>[data-role=close]').hide();
},

events: {
Expand Down Expand Up @@ -198,9 +198,9 @@ var Dialog = Overlay.extend({

_onRenderCloseTpl: function (val) {
if (val === '') {
this.$('[data-role=close]').html(val).hide();
this.$('>[data-role=close]').html(val).hide();
} else {
this.$('[data-role=close]').html(val).show();
this.$('>[data-role=close]').html(val).show();
}
},

Expand Down

0 comments on commit e695da4

Please sign in to comment.