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

Commit

Permalink
Closure docs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tvoliter committed Jan 22, 2012
1 parent 8152114 commit 4d13846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/DocumentManager.js
Expand Up @@ -274,9 +274,11 @@ define(function(require, exports, module) {
$(exports).triggerHandler("workingSetRemove", document);
}

/**
* @param {!FileEntry} fileEntry
* @returns {number} index
/**
* Returns the index of the file matching fullPath in the working set.
* Returns -1 if not found.
* @param {!string} fullPath
* @returns {number} index
*/
function findInWorkingSet(fullPath) {
for (var i = 0; i < _workingSet.length; i++) {
Expand Down
8 changes: 4 additions & 4 deletions src/FileCommandHandlers.js
Expand Up @@ -263,13 +263,13 @@ define(function(require, exports, module) {
/**
* Closes the specified document. Prompts user about saving file if document is dirty.
*
* @param {?Document} doc Document to close; assumes the current document if null.
* @param {?{doc: Document}} commandData Document to close; assumes the current document if null.
* @param {boolean} promptOnly If true, only displays the relevant confirmation UI and does NOT
* actually close the document. This is useful when chaining file-close together with
* other user prompts that may be cancelable.
* @return {$.Deferred}
*/
function handleFileClose( commandData ) {
function handleFileClose(commandData) {
var doc = null;
if(commandData)
doc = commandData.doc;
Expand Down Expand Up @@ -337,7 +337,7 @@ define(function(require, exports, module) {
/**
* Closes all open documents; equivalent to calling handleFileClose() for each document, except
* that unsaved changes are confirmed once, in bulk.
* @param {boolean} promptOnly If true, only displays the relevant confirmation UI and does NOT
* @param {?{promptOnly: boolean}} If true, only displays the relevant confirmation UI and does NOT
* actually close any documents. This is useful when chaining close-all together with
* other user prompts that may be cancelable.
* @return {$.Deferred}
Expand Down Expand Up @@ -400,7 +400,7 @@ define(function(require, exports, module) {
// NOTE: this still happens before any done() handlers added by our caller, because jQ
// guarantees that handlers run in the order they are added.
result.done(function() {
if (!commandData.promptOnly)
if (!commandData || !commandData.promptOnly)
DocumentManager.closeAll();
});

Expand Down

0 comments on commit 4d13846

Please sign in to comment.