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

Commit fd1d213

Browse files
author
Narciso Jaramillo
committed
JSLint cleanups. Removed a TODO and added API note for inline widgets.
1 parent 1dbf460 commit fd1d213

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/editor/Editor.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,10 @@ define(function (require, exports, module) {
807807
if (start.line <= pos.line && end.line >= pos.line) {
808808
if (endInclusive) {
809809
return (start.line < pos.line || start.ch <= pos.ch) && // inclusive
810-
(end.line > pos.line || end.ch >= pos.ch); // inclusive
810+
(end.line > pos.line || end.ch >= pos.ch); // inclusive
811811
} else {
812812
return (start.line < pos.line || start.ch <= pos.ch) && // inclusive
813-
(end.line > pos.line || end.ch > pos.ch); // exclusive
813+
(end.line > pos.line || end.ch > pos.ch); // exclusive
814814
}
815815

816816
}
@@ -1060,10 +1060,7 @@ define(function (require, exports, module) {
10601060

10611061
// Callback to widget once parented to the editor. The widget should call back to
10621062
// setInlineWidgetHeight() in order to set its initial height and animate open.
1063-
// TODO: Should we make onAdded() return the desired height so that it's a
1064-
// required part of the API, instead of people just having to know that they
1065-
// need to call setInlineWidgetHeight() at least once?
1066-
inlineWidget.onAdded();
1063+
inlineWidget.onAdded();
10671064
});
10681065
};
10691066

src/editor/InlineWidget.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ define(function (require, exports, module) {
8989
/**
9090
* Called once content is parented in the host editor's DOM. Useful for performing tasks like setting
9191
* focus or measuring content, which require htmlContent to be in the DOM tree.
92+
* IMPORTANT: onAdded() must ensure that hostEditor.setInlineWidgetHeight() is called at least once in order
93+
* to set the initial height of the widget and animate it open.
9294
*/
9395
InlineWidget.prototype.onAdded = function () {
9496
// Does nothing in base implementation.

src/extensions/default/QuickView/unittests.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ define(function (require, exports, module) {
308308
var bounds = getBounds(object, false),
309309
editorBounds = getBounds(testWindow.$("#editor-holder"), true);
310310
return bounds.left >= editorBounds.left &&
311-
bounds.right <= editorBounds.right &&
312-
bounds.top >= editorBounds.top &&
313-
bounds.bottom <= editorBounds.bottom;
311+
bounds.right <= editorBounds.right &&
312+
bounds.top >= editorBounds.top &&
313+
bounds.bottom <= editorBounds.bottom;
314314
}
315315

316316
function toggleOption(commandID, text) {

0 commit comments

Comments
 (0)