Merge pull request #68 from queryselector/issue-19

Fixed #19
pull/3/merge
Jens Mönig 2013-04-23 08:07:04 -07:00
commit 8a7faaa7f5
1 zmienionych plików z 7 dodań i 8 usunięć

Wyświetl plik

@ -558,8 +558,7 @@ SyntaxElementMorph.prototype.reactToGrabOf = function (grabbedMorph) {
comment.align(topBlock); comment.align(topBlock);
}); });
if (topBlock.getHighlight()) { if (topBlock.getHighlight()) {
topBlock.removeHighlight(); topBlock.addHighlight(topBlock.removeHighlight());
topBlock.addHighlight();
} }
} }
}; };
@ -1377,8 +1376,7 @@ SyntaxElementMorph.prototype.fixLayout = function () {
SyntaxElementMorph.prototype.fixHighlight = function () { SyntaxElementMorph.prototype.fixHighlight = function () {
var top = this.topBlock(); var top = this.topBlock();
if (top.getHighlight && top.getHighlight()) { if (top.getHighlight && top.getHighlight()) {
top.removeHighlight(); top.addHighlight(top.removeHighlight());
top.addHighlight();
} }
}; };
@ -2127,13 +2125,13 @@ BlockMorph.prototype.eraseHoles = function (context) {
// BlockMorph highlighting // BlockMorph highlighting
BlockMorph.prototype.addHighlight = function () { BlockMorph.prototype.addHighlight = function (oldHighlight) {
var isHidden = !this.isVisible, var isHidden = !this.isVisible,
highlight; highlight;
if (isHidden) {this.show(); } if (isHidden) {this.show(); }
highlight = this.highlight( highlight = this.highlight(
this.activeHighlight, oldHighlight ? oldHighlight.color : this.activeHighlight,
this.activeBlur, this.activeBlur,
this.activeBorder this.activeBorder
); );
@ -2166,6 +2164,7 @@ BlockMorph.prototype.removeHighlight = function () {
this.fullChanged(); this.fullChanged();
this.removeChild(highlight); this.removeChild(highlight);
} }
return highlight;
}; };
BlockMorph.prototype.toggleHighlight = function () { BlockMorph.prototype.toggleHighlight = function () {
@ -2181,6 +2180,7 @@ BlockMorph.prototype.highlight = function (color, blur, border) {
fb = this.fullBounds(), fb = this.fullBounds(),
edge = useBlurredShadows ? blur : border; edge = useBlurredShadows ? blur : border;
highlight.setExtent(fb.extent().add(edge * 2)); highlight.setExtent(fb.extent().add(edge * 2));
highlight.color = color;
highlight.image = useBlurredShadows ? highlight.image = useBlurredShadows ?
this.highlightImageBlurred(color, blur) this.highlightImageBlurred(color, blur)
: this.highlightImage(color, border); : this.highlightImage(color, border);
@ -2533,8 +2533,7 @@ BlockMorph.prototype.snap = function () {
this.removeHighlight(); this.removeHighlight();
} }
if (top.getHighlight()) { if (top.getHighlight()) {
top.removeHighlight(); top.addHighlight(top.removeHighlight());
top.addHighlight();
} }
}; };