-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63a8656
commit 31d6135
Showing
6 changed files
with
40 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ax5ui-modal", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"authors": [ | ||
"ThomasJ <[email protected]>" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,8 @@ | |
/** | ||
* @class ax5.ui.modal | ||
* @classdesc | ||
* @version v0.0.1 | ||
* @version 0.5.3 | ||
* @author [email protected] | ||
* @logs | ||
* 2014-06-23 tom : 시작 | ||
* @example | ||
* ``` | ||
* var my_modal = new ax5.ui.modal(); | ||
|
@@ -52,7 +50,9 @@ | |
* ``` | ||
*/ | ||
//== class body start | ||
this.init = function () {}; | ||
this.init = function () { | ||
this.onStateChanged = cfg.onStateChanged; | ||
}; | ||
|
||
this.getContent = function (modalId, opts) { | ||
var po = [], | ||
|
@@ -143,9 +143,11 @@ | |
this.$["iframe-form"].attr({ "target": opts.id + "-frame" }); | ||
this.$["iframe-form"].attr({ "action": opts.iframe.url }); | ||
this.$["iframe"].on("load", function () { | ||
that.state = "load"; | ||
if (opts && opts.onStateChanged) { | ||
that.state = "load"; | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
}.bind(this)); | ||
this.$["iframe-form"].submit(); | ||
|
@@ -154,6 +156,8 @@ | |
if (callBack) callBack.call(that); | ||
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
|
||
// bind key event | ||
|
@@ -242,12 +246,14 @@ | |
setTimeout(function () { | ||
this.activeModal.remove(); | ||
this.activeModal = null; | ||
that = { | ||
self: this, | ||
state: "close" | ||
}; | ||
if (opts && opts.onStateChanged) { | ||
that = { | ||
self: this, | ||
state: "close" | ||
}; | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
}.bind(this), cfg.animateTime); | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,8 @@ | |
/** | ||
* @class ax5.ui.modal | ||
* @classdesc | ||
* @version v0.0.1 | ||
* @version 0.5.3 | ||
* @author [email protected] | ||
* @logs | ||
* 2014-06-23 tom : 시작 | ||
* @example | ||
* ``` | ||
* var my_modal = new ax5.ui.modal(); | ||
|
@@ -52,7 +50,7 @@ | |
*/ | ||
//== class body start | ||
this.init = function () { | ||
|
||
this.onStateChanged = cfg.onStateChanged; | ||
}; | ||
|
||
this.getContent = function (modalId, opts) { | ||
|
@@ -146,10 +144,13 @@ | |
this.$["iframe-form"].attr({"target": opts.id + "-frame"}); | ||
this.$["iframe-form"].attr({"action": opts.iframe.url}); | ||
this.$["iframe"].on("load", (function () { | ||
that.state = "load"; | ||
if (opts && opts.onStateChanged) { | ||
that.state = "load"; | ||
opts.onStateChanged.call(that, that); | ||
} | ||
else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
}).bind(this)); | ||
this.$["iframe-form"].submit(); | ||
} | ||
|
@@ -158,6 +159,9 @@ | |
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} | ||
else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
|
||
// bind key event | ||
if (opts.closeToEsc) { | ||
|
@@ -252,13 +256,16 @@ | |
setTimeout((function () { | ||
this.activeModal.remove(); | ||
this.activeModal = null; | ||
that = { | ||
self: this, | ||
state: "close" | ||
}; | ||
if (opts && opts.onStateChanged) { | ||
that = { | ||
self: this, | ||
state: "close" | ||
}; | ||
opts.onStateChanged.call(that, that); | ||
} | ||
else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
}).bind(this), cfg.animateTime); | ||
} | ||
return this; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters