level 9
Ext.util.Region.override({
colors: ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet'],
nextColor: 0,
show: function(){
var style = {
display: 'block',
position: 'absolute',
top: this.top + 'px',
left: this.left + 'px',
height: ((this.bottom - this.top) + 1) + 'px',
width: ((this.right - this.left) + 1) + 'px',
opacity: 0.3,
'pointer-events': 'none',
'z-index': 9999999
};
if (!this.highlightEl) {
style['background-color'] = this.colors[this.nextColor];
Ext.util.Region.prototype.nextColor++;
this.highlightEl = Ext.getBody().createChild({
style: style
});
if (this.nextColor >= this.colors.length) {
this.nextColor = 0;
}
} else {
this.highlightEl.setStyle(style);
}
},
hide: function(){
if (this.highlightEl) {
this.highlightEl.setStyle({
display: 'none'
});
}
}
});
2013年07月22日 03点07分