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

Inline Editor Close Button #5443

Merged
merged 8 commits into from
Oct 10, 2013
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions src/editor/InlineTextEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ define(function (require, exports, module) {

// header containing filename, dirty indicator, line number
var $header = $("<div/>").addClass("inline-editor-header");

var $filenameInfo = $("<a/>").addClass("filename");

// dirty indicator, with file path stored on it
Expand Down
12 changes: 10 additions & 2 deletions src/editor/InlineWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,16 @@ define(function (require, exports, module) {
this.htmlContent = window.document.createElement("div");
this.$htmlContent = $(this.htmlContent).addClass("inline-widget");
this.$htmlContent.append("<div class='shadow top' />")
.append("<div class='shadow bottom' />");

.append("<div class='shadow bottom' />")
.append("<a href='#' class='close'>&times;</a>");

// create the close button
this.$closeBtn = this.$htmlContent.find('.close');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Please use double quote for strings as this is our coding convention.

this.$closeBtn.click(function (e) {
self.close();
e.stopImmediatePropagation();
});

this.$htmlContent.on("keydown", function (e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
self.close();
Expand Down
9 changes: 9 additions & 0 deletions src/styles/brackets.less
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,15 @@ a, img {
background-color: @inline-background-color-1;
}
}

.close {
position: relative;
float: left;
left: 15px;
top: 10px;
margin-right: 30px;
}

}

/* CSSInlineEditor rule list */
Expand Down