Comparing version 1.1.2 to 1.1.3
@@ -5,2 +5,6 @@ # History | ||
## 1.1.3 | ||
`new` 引入`aniam-class`,方便`anima-pop`进行继承扩展 | ||
## 1.1.2 | ||
@@ -7,0 +11,0 @@ |
{ | ||
"name": "anima-pop", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "The best project ever.", | ||
@@ -32,3 +32,4 @@ "homepage": "http://gitlab.alibaba-inc.com/animajs/pop", | ||
"anima-yocto-lite": "~1.1.0", | ||
"import-style": "1.0.0" | ||
"import-style": "1.0.0", | ||
"anima-class": "~1.0.0" | ||
}, | ||
@@ -35,0 +36,0 @@ "devDependencies": { |
@@ -5,3 +5,7 @@ /** | ||
*/ | ||
require('./pop.css'); | ||
var $ = require('anima-yocto-lite'), | ||
Cls = require('anima-class'), | ||
Position = require('./position'), | ||
@@ -14,4 +18,4 @@ Animate = require('./animate'), | ||
function Pop(config){ | ||
this.attrs = $.extend(true, {}, Position.ATTRS, Mask.ATTRS, Animate.ATTRS, Align.ATTRS,{ | ||
var Pop = Cls.create({ | ||
attrs : $.extend(true,{},Position.ATTRS,Mask.ATTRS,Animate.ATTRS,Align.ATTRS,{ | ||
width : null, | ||
@@ -21,17 +25,12 @@ height : null, | ||
className : 'am-pop', | ||
effect : 'none', | ||
template: '<div></div>', | ||
// 组件的默认父节点 | ||
parentNode: document.body | ||
}, config); | ||
effect : 'none' | ||
}) | ||
}); | ||
// 是否由 template 初始化 | ||
this._isTemplate = !(config && config.element); | ||
Pop.implement([Position.prototype, Mask.prototype, Animate.prototype, Align.prototype, { | ||
//初始化事件 | ||
initialize : function (config) { | ||
this.setup(); | ||
} | ||
this.attrs = $.extend(true, {}, this.attrs, config); | ||
Pop.prototype = $.extend(true, {}, Position.prototype, Mask.prototype, Animate.prototype, Align.prototype, { | ||
//初始化事件 | ||
setup : function () { | ||
this.parseElement(); | ||
@@ -42,2 +41,4 @@ | ||
this.processMask(); | ||
this._isTemplate = !(config && config.element); | ||
}, | ||
@@ -202,19 +203,15 @@ // 构建 this.element | ||
this.element = null; | ||
} | ||
}); | ||
}, | ||
get: function(key){ | ||
return this.attrs[key] === undefined ? null : this.attrs[key]; | ||
}, | ||
set: function(key, val){ | ||
this.attrs[key] = val; | ||
Pop.prototype.constructor = Pop; | ||
this[ON_RENDER + ucfirst(key)] && this[ON_RENDER + ucfirst(key)](val); | ||
Pop.prototype.get = function(key){ | ||
return this.attrs[key] || null; | ||
}; | ||
return this; | ||
} | ||
}]); | ||
Pop.prototype.set = function(key, val){ | ||
this.attrs[key] = val; | ||
this[ON_RENDER + ucfirst(key)] && this[ON_RENDER + ucfirst(key)](val); | ||
return this; | ||
}; | ||
module.exports = Pop; | ||
@@ -221,0 +218,0 @@ |
17981
3
605
+ Addedanima-class@~1.0.0
+ Addedanima-class@1.0.0(transitive)