This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix for issue #1122 #1661
Merged
Merged
Fix for issue #1122 #1661
Changes from 12 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
164ffa8
- Basic bottom panel resize behaviour
jbalsas 3b05f42
Combine both panels to get available height.
jbalsas 19fa897
- Removed panels coupling
jbalsas 22855c0
Merge branch 'master' of https://github.com/adobe/brackets into jslin…
jbalsas e714f38
Cleanup vars and comments
jbalsas cbadfc4
Fix bug in search panel resize with toolbar height
jbalsas e2ff4ea
Fixed comment indentation
jbalsas 9e25576
Use outerHeight() for toolbars height to account for paddings and mar…
jbalsas e853066
Resize behavior refactored in utils/Resizer
jbalsas ea3354c
Generalization for both resize directions
jbalsas 6a933a3
Added position selection for future resizer position implementations
jbalsas 5559cd3
Comments and clean up
jbalsas c561ef0
Cleanup changes for pull request review
jbalsas 2044846
Merge branch 'master' of https://github.com/adobe/brackets into jslin…
jbalsas 8f1cfb2
Final comments cleanup
jbalsas aab262d
Merge branch 'master' of https://github.com/adobe/brackets into jslin…
jbalsas ab2645a
Rename "ver" and "hor" for easier to remember "vert" and "horz".
jbalsas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
|
||
|
||
/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ | ||
/*global define, $, brackets, JSLINT, PathUtils */ | ||
/*global define, $, JSLINT, PathUtils, document, window */ | ||
|
||
/** | ||
* Allows JSLint to run on the current document and report results in a UI panel. | ||
|
@@ -44,8 +44,13 @@ define(function (require, exports, module) { | |
EditorManager = require("editor/EditorManager"), | ||
PreferencesManager = require("preferences/PreferencesManager"), | ||
PerfUtils = require("utils/PerfUtils"), | ||
Strings = require("strings"); | ||
|
||
Strings = require("strings"), | ||
AppInit = require("utils/AppInit"), | ||
Resizer = require("utils/Resizer"); | ||
|
||
var PREFERENCES_CLIENT_ID = module.id, | ||
defaultPrefs = { height: 200, enabled: true }; | ||
|
||
/** | ||
* @private | ||
* @type {PreferenceStorage} | ||
|
@@ -200,16 +205,35 @@ define(function (require, exports, module) { | |
setEnabled(!getEnabled()); | ||
} | ||
|
||
|
||
// Register command handlers | ||
CommandManager.register(Strings.CMD_JSLINT, Commands.TOGGLE_JSLINT, _handleToggleJSLint); | ||
|
||
// Init PreferenceStorage | ||
_prefs = PreferencesManager.getPreferenceStorage(module.id, { enabled: !!brackets.config.enable_jslint }); | ||
_prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID, defaultPrefs); | ||
_setEnabled(_prefs.getValue("enabled")); | ||
|
||
// Initialize items dependent on HTML DOM | ||
AppInit.htmlReady(function () { | ||
var height = Math.max(_prefs.getValue("height"), 100), | ||
$jslintResults = $("#jslint-results"), | ||
$jslintContent = $("#jslint-results .table-container"); | ||
|
||
$jslintResults.height(height); | ||
$jslintContent.height(height - 27); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 27 seems to be the header height and should be defined in a constant. Same comment for the FiF panel. |
||
|
||
if (_enabled) { | ||
EditorManager.resizeEditor(); | ||
} | ||
|
||
$.when(Resizer.resizing($jslintResults)).progress(function (status, height) { | ||
if (status === "end") { | ||
_prefs.setValue("height", height); | ||
} | ||
}); | ||
}); | ||
|
||
// Define public API | ||
exports.run = run; | ||
exports.getEnabled = getEnabled; | ||
exports.setEnabled = setEnabled; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
*/ | ||
|
||
/*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ | ||
/*global define, $, PathUtils, window */ | ||
/*global define, $, PathUtils, window, document */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like both document and window are no longer used and can be removed |
||
|
||
/* | ||
* Adds a "find in files" command to allow the user to find all occurances of a string in all files in | ||
|
@@ -50,11 +50,16 @@ define(function (require, exports, module) { | |
DocumentManager = require("document/DocumentManager"), | ||
EditorManager = require("editor/EditorManager"), | ||
FileIndexManager = require("project/FileIndexManager"), | ||
KeyEvent = require("utils/KeyEvent"); | ||
|
||
PreferencesManager = require("preferences/PreferencesManager"), | ||
KeyEvent = require("utils/KeyEvent"), | ||
AppInit = require("utils/AppInit"), | ||
Resizer = require("utils/Resizer"); | ||
|
||
var FIND_IN_FILES_MAX = 100; | ||
|
||
|
||
var PREFERENCES_CLIENT_ID = module.id, | ||
defaultPrefs = { height: 200 }; | ||
|
||
// This dialog class was mostly copied from QuickOpen. We should have a common dialog | ||
// class that everyone can use. | ||
|
||
|
@@ -332,6 +337,23 @@ define(function (require, exports, module) { | |
} | ||
}); | ||
} | ||
|
||
// Initialize items dependent on HTML DOM | ||
AppInit.htmlReady(function () { | ||
var $searchResults = $("#search-results"), | ||
$searchContent = $("#search-results .table-container"), | ||
prefs = PreferencesManager.getPreferenceStorage(module.id, defaultPrefs), | ||
height = prefs.getValue("height"); | ||
|
||
$searchResults.height(height); | ||
$searchContent.height(height - 27); | ||
|
||
$.when(Resizer.resizing($("#search-results"))).progress(function (status, height) { | ||
if (status === "end") { | ||
prefs.setValue("height", height); | ||
} | ||
}); | ||
}); | ||
|
||
CommandManager.register(Strings.CMD_FIND_IN_FILES, Commands.EDIT_FIND_IN_FILES, doFindInFiles); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,6 +67,12 @@ body { | |
&.resizing a, &.resizing #projects a, &.resizing .main-view, &.resizing .CodeMirror-lines { | ||
cursor: col-resize; | ||
} | ||
|
||
/* This appears to be necessary in Firefox when body is set to display: box. */ | ||
height: 100%; | ||
&.ver-resizing a, &.ver-resizing #projects a, &.ver-resizing .main-view, &.ver-resizing .CodeMirror-lines { | ||
cursor: row-resize; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Brackets currently doesn't support Firefox, so is this necessary? Maybe the comment is incorrect. |
||
} | ||
|
||
|
||
|
@@ -108,14 +114,32 @@ a, img { | |
background: @background-color-2 url('images/no_content_bg.svg') no-repeat center 45%; | ||
} | ||
} | ||
|
||
|
||
.ver-resizer { | ||
position: absolute; | ||
height: 6px; | ||
width: 100%; | ||
z-index: @z-index-brackets-panel-resizer; | ||
opacity: 0; | ||
cursor: row-resize; | ||
} | ||
|
||
.hor-resizer { | ||
position: absolute; | ||
height: 100%; | ||
width: 6px; | ||
z-index: @z-index-brackets-panel-resizer; | ||
opacity: 0; | ||
cursor: col-resize; | ||
} | ||
|
||
.bottom-panel { | ||
display: none; | ||
height: 200px; | ||
border-top-style: solid; | ||
border-width: 1px; | ||
border-color: lighten(@bc-grey, @bc-color-step-size*4); | ||
|
||
.toolbar { | ||
height: auto; | ||
padding-top: @base-padding / 2; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like both document and window are no longer used and can be removed