Skip to content

Commit

Permalink
change class structure
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasJang committed Jan 26, 2016
1 parent b2e3f8b commit e59e801
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 40 deletions.
13 changes: 12 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You define the default settings for the dialog. Create a ax5.ui.dialog instance,

```js
var myDialog = new ax5.ui.dialog();
myDialog.set_config({
myDialog.setConfig({
title: [String],
theme: [String],
width: [Number],
Expand All @@ -17,6 +17,17 @@ myDialog.set_config({
});
```

**Easy Way - without setConfig**
```js
var myDialog = new ax5.ui.dialog({
title: [String],
theme: [String],
width: [Number],
onStateChanged: [Function],
btns: [Object],
input: [Object]
});
```

### title

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ exactly the path.

### Basic Usages
```js
var myDialog = new ax5.ui.dialog();
myDialog.set_config({
var myDialog = new ax5.ui.dialog({
title: '<i class="axi axi-ion-alert"></i> Default alert',
onStateChanged: function(){

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-ax5dialog",
"version": "0.5.0",
"version": "0.6.0",
"authors": [
"ThomasJ <[email protected]>"
],
Expand Down
36 changes: 19 additions & 17 deletions dist/ax5dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,19 @@
self = this,
cfg;

// 클래스 생성자
this.main = (function () {
if (_SUPER_) _SUPER_.call(this); // 부모호출
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchend" : "click"),
theme: 'default',
width: 300,
title: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
animateTime: 250
};
}).apply(this, arguments);

if (_SUPER_) _SUPER_.call(this); // 부모호출
this.activeDialog = null;
// extended config copy cfg
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchend" : "click"),
theme: 'default',
width: 300,
title: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
animateTime: 250
};
cfg = this.config;
cfg.id = 'ax5-dialog-' + ax5.getGuid();

Expand Down Expand Up @@ -419,6 +414,13 @@
}
return this;
}

// 클래스 생성자
this.main = (function () {
if(arguments && U.isObject(arguments[0])) {
this.setConfig(arguments[0]);
}
}).apply(this, arguments);
};
//== UI Class

Expand Down
2 changes: 1 addition & 1 deletion dist/ax5dialog.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-ax5dialog",
"version": "0.5.0",
"version": "0.6.0",
"description": "A dialog plugin that works with Bootstrap & jQuery",
"license": "MIT",
"repository": {
Expand Down
36 changes: 19 additions & 17 deletions src/ax5dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,19 @@
self = this,
cfg;

// 클래스 생성자
this.main = (function () {
if (_SUPER_) _SUPER_.call(this); // 부모호출
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchend" : "click"),
theme: 'default',
width: 300,
title: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
animateTime: 250
};
}).apply(this, arguments);

if (_SUPER_) _SUPER_.call(this); // 부모호출
this.activeDialog = null;
// extended config copy cfg
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchend" : "click"),
theme: 'default',
width: 300,
title: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
animateTime: 250
};
cfg = this.config;
cfg.id = 'ax5-dialog-' + ax5.getGuid();

Expand Down Expand Up @@ -419,6 +414,13 @@
}
return this;
}

// 클래스 생성자
this.main = (function () {
if(arguments && U.isObject(arguments[0])) {
this.setConfig(arguments[0]);
}
}).apply(this, arguments);
};
//== UI Class

Expand Down

0 comments on commit e59e801

Please sign in to comment.