Skip to content

Commit

Permalink
try to fixes #367
Browse files Browse the repository at this point in the history
  • Loading branch information
Minwe committed Jan 7, 2015
1 parent 6821ad2 commit 6b3c111
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,12 @@
# Amaze UI Change Log
---

### 2015.01 W1

- `IMPROVED` #367 尝试修复 Modal 遮罩层关闭回调函数被触发多次问题;

## Amaze UI 2.1.0-beta1

### 2014.12 W4

**JS:**
Expand Down
16 changes: 8 additions & 8 deletions js/ui.dimmer.js
Expand Up @@ -13,7 +13,7 @@ var Dimmer = function() {

this.inited = false;
this.scrollbarWidth = 0;
this.used = $([]);
this.$used = $([]);
};

Dimmer.DEFAULTS = {
Expand All @@ -39,12 +39,12 @@ Dimmer.prototype.open = function(relatedElement) {

// 用于多重调用
if (relatedElement) {
this.used = this.used.add($(relatedElement));
this.$used = this.$used.add($(relatedElement));
}

this.checkScrollbar().setScrollbar();

$element.show().trigger('open.dimmer.amui');
$element.off(transition.end).show().trigger('open.dimmer.amui');

setTimeout(function() {
$element.addClass('am-active');
Expand All @@ -54,9 +54,9 @@ Dimmer.prototype.open = function(relatedElement) {
};

Dimmer.prototype.close = function(relatedElement, force) {
this.used = this.used.not($(relatedElement));
this.$used = this.$used.not($(relatedElement));

if (!force && this.used.length) {
if (!force && this.$used.length) {
return this;
}

Expand All @@ -65,12 +65,12 @@ Dimmer.prototype.close = function(relatedElement, force) {
$element.removeClass('am-active').trigger('close.dimmer.amui');

function complete() {
this.resetScrollbar();
$element.hide();
this.resetScrollbar();
}

transition ? $element.one(transition.end, $.proxy(complete, this)) :
complete.call(this);
// transition ? $element.one(transition.end, $.proxy(complete, this)) :
complete.call(this);

return this;
};
Expand Down
2 changes: 1 addition & 1 deletion less/ui.component.less
Expand Up @@ -86,7 +86,7 @@ tbody.@{ns}collapse.@{ns}in {
background-color: rgba(0, 0, 0, .6);
z-index: @z-index-dimmer;
opacity: 0;
transition: opacity .15s;
// transition: opacity .15s;

&.@{ns}active {
opacity: 1;
Expand Down

0 comments on commit 6b3c111

Please sign in to comment.