-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnode.js
40 lines (31 loc) · 788 Bytes
/
node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var Class = require('../../core/class');
var Transform = require('../../core/transform');
var Element = require('../../dom/shadow');
var DOM = require('./dom');
module.exports = Class(Element, Transform, {
initialize: function(tag){
//this.uid = uniqueID();
var element = this.element = DOM.createElement(tag);
//element.setAttribute('id', 'e' + this.uid);
},
_place: function(){
if (this.parentNode){
this._transform();
}
},
// visibility
hide: function(){
this.element.style.display = 'none';
return this;
},
show: function(){
this.element.style.display = '';
return this;
},
// interaction
indicate: function(cursor, tooltip){
if (cursor) this.element.style.cursor = cursor;
if (tooltip) this.element.title = tooltip;
return this;
}
});