Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix unit tests broken by modal bar animation #4800

Merged
merged 1 commit into from
Aug 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ a, img {

/* Modal bar for Find/Quick Open */

.modal-bar.hide {
.modal-bar.modal-bar-hide {
position: absolute;
left: 0;
right: 0;
Expand Down
9 changes: 5 additions & 4 deletions src/widgets/ModalBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ define(function (require, exports, module) {
this._handleInputKeydown = this._handleInputKeydown.bind(this);
this._handleFocusChange = this._handleFocusChange.bind(this);

this._$root = $("<div class='modal-bar hide'/>")
this._$root = $("<div class='modal-bar modal-bar-hide'/>")
.html(template)
.insertBefore("#editor-holder");

// Forcing the renderer to do a layout, which will cause it to apply the transform for the "hide" class, so it will animate when you remove the class.
// Forcing the renderer to do a layout, which will cause it to apply the transform for the "modal-bar-hide"
// class, so it will animate when you remove the class.
window.getComputedStyle(this._$root.get(0)).getPropertyValue("top");
this._$root.removeClass("hide");
this._$root.removeClass("modal-bar-hide");

// If something *other* than an editor (like another modal bar) has focus, set the focus
// to the editor here, before opening up the new modal bar. This ensures that the old
Expand Down Expand Up @@ -128,7 +129,7 @@ define(function (require, exports, module) {
}

var self = this;
this._$root.addClass("hide").one("webkitTransitionEnd", function () {
this._$root.addClass("modal-bar-hide").one("webkitTransitionEnd", function () {
self._$root.remove();
});

Expand Down
Loading