Skip to content

Commit ace146f

Browse files
committed
comments
1 parent a97580a commit ace146f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

src/parts/BaseEl.js

+33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
FPDF.BaseEl = stdClass.extend({
22
defaultCss:{},
33
_name:'BaseEl',
4+
5+
46
constructor:function(parent){
57
this.styles = {};
68

@@ -26,6 +28,12 @@ FPDF.BaseEl = stdClass.extend({
2628
});
2729
return this;
2830
},
31+
32+
/**
33+
* Set css-style-attributes on the element.
34+
* @param {object} styles
35+
* @return {element}
36+
*/
2937
css:function(styles){
3038
for(var n in styles){
3139
this.styles[n] = styles[n];
@@ -125,6 +133,13 @@ FPDF.BaseEl = stdClass.extend({
125133
this.parent.c.y += this.outerHeight();
126134
}
127135
},
136+
137+
138+
/**
139+
* Appends an element to this one.
140+
* @param {FPDF-element} el
141+
* @return {this}
142+
*/
128143
append:function(el){
129144
if(el){
130145
if(el.parent) {
@@ -137,6 +152,12 @@ FPDF.BaseEl = stdClass.extend({
137152

138153
return this;
139154
},
155+
156+
/**
157+
* Prepends an element to this one.
158+
* @param {FPDF-element} el
159+
* @return {this}
160+
*/
140161
prepend:function(el){
141162
if(el){
142163
if(el.parent) {
@@ -149,10 +170,22 @@ FPDF.BaseEl = stdClass.extend({
149170

150171
return this;
151172
},
173+
174+
/**
175+
* Appends itself to the given element.
176+
* @param {FPDF-element} el
177+
* @return {this}
178+
*/
152179
appendTo:function(el){
153180
el.append(this);
154181
return this;
155182
},
183+
184+
/**
185+
* Prepends itself to the given element
186+
* @param {FPDF-element} el
187+
* @return {this}
188+
*/
156189
prependTo:function(el){
157190
el.prepend(this);
158191
return this;

0 commit comments

Comments
 (0)