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 83ba3ed commit d2fd09d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 33 deletions.
10 changes: 10 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ mask.setConfig({
}
});
```
**Easy Way - without setConfig**
```js
var mask = new ax5.ui.mask({
zIndex: 1000,
content: 'Loading content',
onStateChanged: function(){
console.log(this);
}
});
```
```json
{
[target: {Element} - target of mask,]
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-ax5mask",
"version": "0.4.0",
"version": "0.5.0",
"authors": [
"ThomasJ <[email protected]>"
],
Expand Down
35 changes: 20 additions & 15 deletions dist/ax5mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
var U = ax5.util;

var axClass = function () {
var self = this;

// 클래스 생성자
this.main = (function () {
if (_SUPER_) _SUPER_.call(this); // 부모호출
this.config = {
theme: '',
target: jQuery(document.body).get(0)
};
this.maskContent = '';
this.status = "off";
var
self = this
;

if (_SUPER_) _SUPER_.call(this); // 부모호출
this.maskContent = '';
this.status = "off";
this.config = {
theme: '',
target: jQuery(document.body).get(0)
};
var cfg = this.config;

}).apply(this, arguments);

/**
* Preferences of Mask UI
Expand All @@ -44,9 +44,6 @@
* }
* ```
*/
//== class body start
var cfg = this.config;

this.init = function () {
// after setConfig();
if (this.config.content) this.setBody(this.config.content);
Expand Down Expand Up @@ -158,6 +155,14 @@
return this;
};
//== class body end


// 클래스 생성자
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/ax5mask.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-ax5mask",
"version": "0.4.0",
"version": "0.5.0",
"description": "A mask plugin that works with Bootstrap & jQuery",
"license": "MIT",
"repository": {
Expand Down
35 changes: 20 additions & 15 deletions src/ax5mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
var U = ax5.util;

var axClass = function () {
var self = this;

// 클래스 생성자
this.main = (function () {
if (_SUPER_) _SUPER_.call(this); // 부모호출
this.config = {
theme: '',
target: jQuery(document.body).get(0)
};
this.maskContent = '';
this.status = "off";
var
self = this
;

if (_SUPER_) _SUPER_.call(this); // 부모호출
this.maskContent = '';
this.status = "off";
this.config = {
theme: '',
target: jQuery(document.body).get(0)
};
var cfg = this.config;

}).apply(this, arguments);

/**
* Preferences of Mask UI
Expand All @@ -44,9 +44,6 @@
* }
* ```
*/
//== class body start
var cfg = this.config;

this.init = function () {
// after setConfig();
if (this.config.content) this.setBody(this.config.content);
Expand Down Expand Up @@ -158,6 +155,14 @@
return this;
};
//== class body end


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

//== ui class 공통 처리 구문
Expand Down

0 comments on commit d2fd09d

Please sign in to comment.