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 f44cdb5 commit 803dec3
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 48 deletions.
16 changes: 15 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ myToast.set_config({
lang: "Object"
});
```

**Easy Way - without setConfig**
```js
var myToast = new ax5.ui.toast({
msg: "String",
theme: "String",
width: "Number",
icon: "String",
closeIcon: "String",
onStateChanged: "Function",
displayTime: "Number",
animateTime: "Number",
containerPosition: "String",
lang: "Object"
});
```

### msg

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

### Basic Usages
```js
var myToast = new ax5.ui.toast();
myToast.setConfig({
var myToast = new ax5.ui.toast({
icon: '<i class="fa fa-bug"></i>',
containerPosition: "bottom-right",
closeIcon: '<i class="fa fa-times"></i>'
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-ax5toast",
"version": "0.1.0",
"version": "0.2.0",
"authors": [
"ThomasJ <[email protected]>"
],
Expand Down
45 changes: 24 additions & 21 deletions dist/ax5toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@
var
self = this,
cfg;

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


if (_SUPER_) _SUPER_.call(this); // 부모호출
this.toastContainer = null;
this.queue = [];
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchstart" : "click"),
theme: 'default',
width: 300,
icon: '',
closeIcon: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
displayTime: 3000,
animateTime: 250,
containerPosition: "bottom-left"
};
cfg = this.config;

/**
Expand Down Expand Up @@ -265,7 +261,14 @@
}
}, cfg.animateTime);
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/ax5toast.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-ax5toast",
"version": "0.1.0",
"version": "0.2.0",
"description": "A toast plugin that works with Bootstrap & jQuery",
"license": "MIT",
"repository": {
Expand Down
45 changes: 24 additions & 21 deletions src/ax5toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@
var
self = this,
cfg;

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


if (_SUPER_) _SUPER_.call(this); // 부모호출
this.toastContainer = null;
this.queue = [];
this.config = {
clickEventName: "click", //(('ontouchstart' in document.documentElement) ? "touchstart" : "click"),
theme: 'default',
width: 300,
icon: '',
closeIcon: '',
msg: '',
lang: {
"ok": "ok", "cancel": "cancel"
},
displayTime: 3000,
animateTime: 250,
containerPosition: "bottom-left"
};
cfg = this.config;

/**
Expand Down Expand Up @@ -265,7 +261,14 @@
}
}, cfg.animateTime);
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 803dec3

Please sign in to comment.