-
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.
- 1.4.112
- 1.4.111
- 1.4.110
- 1.4.109
- 1.4.108
- 1.4.107
- 1.4.106
- 1.4.105
- 1.4.104
- 1.4.103
- 1.4.102
- 1.4.101
- 1.4.100
- 1.4.99
- 1.4.98
- 1.4.97
- 1.4.96
- 1.4.95
- 1.4.94
- 1.4.93
- 1.4.92
- 1.4.91
- 1.4.90
- 1.4.89
- 1.4.88
- 1.4.87
- 1.4.86
- 1.4.85
- 1.4.84
- 1.4.83
- 1.4.82
- 1.4.81
- 1.4.80
- 1.4.79
- 1.4.78
- 1.4.77
- 1.4.76
- 1.4.75
- 1.4.74
- 1.4.73
- 1.4.72
- 1.4.71
- 1.4.70
- 1.4.69
- 1.4.68
- 1.4.67
- 1.4.66
- 1.4.65
- 1.4.64
- 1.4.63
- 1.4.62
- 1.4.61
- 1.4.60
- 1.4.59
- 1.4.58
- 1.4.57
- 1.4.56
- 1.4.55
- 1.4.54
- 1.4.53
- 1.4.52
- 1.4.51
- 1.4.50
- 1.4.49
- 1.4.48
- 1.4.47
- 1.4.46
- 1.4.45
- 1.4.44
- 1.4.43
- 1.4.42
- 1.4.41
- 1.4.40
- 1.4.39
- 1.4.38
- 1.4.31
- 1.4.30
- 1.4.29
- 1.4.28
- 1.4.27
- 1.4.26
- 1.4.25
- 1.4.24
- 1.4.23
- 1.4.22
- 1.4.21
- 1.4.20
- 1.4.19
- 1.4.18
- 1.4.17
- 1.4.16
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.137
- 1.3.136
- 1.3.135
- 1.3.134
- 1.3.133
- 1.3.132
- 1.3.131
- 1.3.130
- 1.3.129
- 1.3.128
- 1.3.127
- 1.3.126
- 1.3.125
- 1.3.124
- 1.3.123
- 1.3.122
- 1.3.121
- 1.3.120
- 1.3.119
- 1.3.118
- 1.3.117
- 1.3.116
- 1.3.115
- 1.3.114
- 1.3.113
- 1.3.112
- 1.3.111
- 1.3.110
- 1.3.109
- 1.3.108
- 1.3.107
- 1.3.106
- 1.3.105
- 1.3.104
- 1.3.103
- 1.3.98
- 1.3.97
- 1.3.96
- 1.3.95
- 1.3.94
- 1.3.93
- 1.3.92
- 1.3.91
- 1.3.90
- 1.3.89
- 1.3.88
- 1.3.87
- 1.3.86
- 1.3.85
- 1.3.82
- 1.3.81
- 1.3.80
- 1.3.79
- 1.3.78
- 1.3.77
- 1.3.76
- 1.3.75
- 1.3.74
- 1.3.73
- 1.3.72
- 1.3.71
- 1.3.70
- 1.3.69
- 1.3.68
- 1.3.67
- 1.3.66
- 1.3.65
- 1.3.64
- 1.3.63
- 1.3.62
- 1.3.61
- 1.3.60
- 1.3.59
- 1.3.58
- 1.3.57
- 1.3.56
- 1.3.55
- 1.3.54
- 1.3.53
- 1.3.52
- 1.3.51
- 1.3.50
- 1.3.49
- 1.3.48
- 1.3.46
- 1.3.45
- 1.3.44
- 1.3.43
- 1.3.42
- 1.3.41
- 1.3.40
- 1.3.39
- 1.3.38
- 1.3.37
- 1.3.36
- 1.3.35
- 1.3.34
- 1.3.33
- 1.3.32
- 1.3.31
- 1.3.30
- 1.3.29
- 1.3.28
- 1.3.27
- 1.3.26
- 1.3.25
- 1.3.24
- 1.3.23
- 1.3.22
- 1.3.21
- 1.3.20
- 1.3.19
- 1.3.18
- 1.3.17
- 1.3.16
- 1.3.15
- 1.3.14
- 1.3.13
- 1.3.12
- 1.3.11
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.51
- 1.2.9
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.9
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.6
- 0.5.5
- 0.5.4
1 parent
8278226
commit 0add3d7
Showing
5 changed files
with
284 additions
and
270 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.3", | ||
"version": "0.5.4", | ||
"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,7 +6,7 @@ | |
/** | ||
* @class ax5.ui.modal | ||
* @classdesc | ||
* @version 0.5.3 | ||
* @version 0.5.4 | ||
* @author [email protected] | ||
* @example | ||
* ``` | ||
|
@@ -40,71 +40,39 @@ | |
cfg = this.config; // extended config copy cfg | ||
cfg.id = 'ax5-modal-' + ax5.getGuid(); // instance id | ||
|
||
/** | ||
* Preferences of modal UI | ||
* @method ax5.ui.modal.setConfig | ||
* @param {Object} config - 클래스 속성값 | ||
* @returns {ax5.ui.modal} | ||
* @example | ||
* ``` | ||
* ``` | ||
*/ | ||
//== class body start | ||
this.init = function () { | ||
this.onStateChanged = cfg.onStateChanged; | ||
}; | ||
|
||
this.getContent = function (modalId, opts) { | ||
var po = [], | ||
styles = []; | ||
|
||
if (opts.zIndex) { | ||
styles.push("z-index:" + opts.zIndex); | ||
var onStateChanged = function onStateChanged(opts, that) { | ||
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
return true; | ||
}, | ||
getContentTmpl = function getContentTmpl() { | ||
return "\n <div id=\"{{modalId}}\" data-modal-els=\"root\" class=\"ax5-ui-modal {{theme}} {{fullscreen}}\" style=\"{{styles}}\">\n <div class=\"ax-modal-body\" data-modal-els=\"body\">\n {{#iframe}}\n <div data-modal-els=\"iframe-wrap\" style=\"-webkit-overflow-scrolling: touch; overflow: auto;position: relative;\">\n <iframe name=\"{{modalId}}-frame\" src=\"\" width=\"100%\" height=\"100%\" frameborder=\"0\" data-modal-els=\"iframe\" style=\"position: absolute;left:0;top:0;\"></iframe>\n </div>\n <form name=\"{{modalId}}-form\" data-modal-els=\"iframe-form\">\n <input type=\"hidden\" name=\"modalId\" value=\"{{modalId}}\" />\n {{#param}}\n {{#@each}}\n <input type=\"hidden\" name=\"{{@key}}\" value=\"{{@value}}\" />\n {{/@each}}\n {{/param}}\n </form>\n {{/iframe}}\n </div>\n </div>\n "; | ||
}, | ||
getContent = function getContent(modalId, opts) { | ||
var data = { | ||
modalId: modalId, | ||
theme: opts.theme, | ||
fullScreen: opts.fullScreen ? "fullscreen" : "", | ||
styles: [], | ||
iframe: opts.iframe | ||
}; | ||
|
||
po.push('<div id="' + modalId + '" data-modal-els="root" class="ax5-ui-modal ' + opts.theme + ' ' + (opts.fullScreen ? "fullscreen" : "") + '" style="' + styles.join(";") + '">'); | ||
po.push('<div class="ax-modal-body" data-modal-els="body">'); | ||
// use iframe | ||
if (opts.iframe) { | ||
po.push('<div data-modal-els="iframe-wrap" style="-webkit-overflow-scrolling: touch; overflow: auto;position: relative;">'); | ||
po.push('<iframe name="' + modalId + '-frame" src="" width="100%" height="100%" frameborder="0" data-modal-els="iframe" style="position: absolute;left:0;top:0;"></iframe>'); | ||
po.push('</div>'); | ||
po.push('<form name="' + modalId + '-form" data-modal-els="iframe-form">'); | ||
po.push('<input type="hidden" name="modalId" value="' + modalId + '" />'); | ||
if (typeof opts.iframe.param === "string") { | ||
opts.iframe.param = ax5.util.param(opts.iframe.param); | ||
} | ||
for (var p in opts.iframe.param) { | ||
po.push('<input type="hidden" name="' + p + '" value="' + opts.iframe.param[p] + '" />'); | ||
} | ||
po.push('</form>'); | ||
if (opts.zIndex) { | ||
data.styles.push("z-index:" + opts.zIndex); | ||
} | ||
po.push('</div>'); | ||
po.push('</div>'); | ||
return po.join(''); | ||
}; | ||
|
||
this.open = function (opts, callBack) { | ||
if (U.isString(opts)) { | ||
opts = { | ||
title: cfg.title, | ||
msg: opts | ||
}; | ||
if (typeof data.iframe.param === "string") { | ||
data.iframe.param = ax5.util.param(data.iframe.param); | ||
} | ||
|
||
self.modalConfig = {}; | ||
jQuery.extend(true, self.modalConfig, cfg); | ||
jQuery.extend(true, self.modalConfig, opts); | ||
opts = self.modalConfig; | ||
|
||
this._open(opts, callBack); | ||
return this; | ||
}; | ||
|
||
this._open = function (opts, callBack) { | ||
return ax5.mustache.render(getContentTmpl(), data); | ||
}, | ||
open = function open(opts, callBack) { | ||
var that; | ||
|
||
jQuery(document.body).append(this.getContent(opts.id, opts)); | ||
jQuery(document.body).append(getContent.call(this, opts.id, opts)); | ||
|
||
this.activeModal = jQuery('#' + opts.id); | ||
|
||
|
@@ -121,7 +89,7 @@ | |
} | ||
|
||
//- position 정렬 | ||
this.align(); | ||
align.call(this); | ||
|
||
that = { | ||
self: this, | ||
|
@@ -144,34 +112,25 @@ | |
this.$["iframe-form"].attr({ "action": opts.iframe.url }); | ||
this.$["iframe"].on("load", function () { | ||
that.state = "load"; | ||
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
onStateChanged.call(this, opts, that); | ||
}.bind(this)); | ||
this.$["iframe-form"].submit(); | ||
} | ||
|
||
if (callBack) callBack.call(that); | ||
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
onStateChanged.call(this, opts, that); | ||
|
||
// bind key event | ||
if (opts.closeToEsc) { | ||
jQuery(window).bind("keydown.ax-modal", function (e) { | ||
this.onkeyup(e || window.event); | ||
onkeyup.call(this, e || window.event); | ||
}.bind(this)); | ||
} | ||
jQuery(window).bind("resize.ax-modal", function (e) { | ||
this.align(null, e || window.event); | ||
align.call(this, null, e || window.event); | ||
}.bind(this)); | ||
}; | ||
|
||
this.align = function (position, e) { | ||
}, | ||
align = function align(position, e) { | ||
if (!this.activeModal) return this; | ||
var opts = self.modalConfig, | ||
box = { | ||
|
@@ -219,14 +178,55 @@ | |
|
||
this.activeModal.css(box); | ||
return this; | ||
}; | ||
|
||
this.onkeyup = function (e) { | ||
}, | ||
onkeyup = function onkeyup(e) { | ||
if (e.keyCode == ax5.info.eventKeys.ESC) { | ||
this.close(); | ||
} | ||
}; | ||
|
||
/// private end | ||
|
||
/** | ||
* Preferences of modal UI | ||
* @method ax5.ui.modal.setConfig | ||
* @param {Object} config - 클래스 속성값 | ||
* @returns {ax5.ui.modal} | ||
* @example | ||
* ``` | ||
* ``` | ||
*/ | ||
//== class body start | ||
this.init = function () { | ||
this.onStateChanged = cfg.onStateChanged; | ||
}; | ||
|
||
/** | ||
* open the modal | ||
* @method ax5.ui.modal.open | ||
* @returns {ax5.ui.modal} | ||
* @example | ||
* ``` | ||
* my_modal.open(); | ||
* ``` | ||
*/ | ||
this.open = function (opts, callBack) { | ||
if (U.isString(opts)) { | ||
opts = { | ||
title: cfg.title, | ||
msg: opts | ||
}; | ||
} | ||
|
||
self.modalConfig = {}; | ||
jQuery.extend(true, self.modalConfig, cfg); | ||
jQuery.extend(true, self.modalConfig, opts); | ||
opts = self.modalConfig; | ||
|
||
open.call(this, opts, callBack); | ||
return this; | ||
}; | ||
|
||
/** | ||
* close the modal | ||
* @method ax5.ui.modal.close | ||
|
@@ -250,11 +250,10 @@ | |
self: this, | ||
state: "close" | ||
}; | ||
if (opts && opts.onStateChanged) { | ||
opts.onStateChanged.call(that, that); | ||
} else if (this.onStateChanged) { | ||
this.onStateChanged.call(that, that); | ||
} | ||
onStateChanged.call(this, opts, { | ||
self: this, | ||
state: "close" | ||
}); | ||
}.bind(this), cfg.animateTime); | ||
} | ||
return this; | ||
|
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