Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/extensibility/ExtensionManagerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ define(function (require, exports, module) {
$dlg.find(".nav-tabs a:first").tab("show");
});

// Handle the install button.
// Handle the install button.
$(".extension-manager-dialog .install-from-url")
.click(function () {
InstallExtensionDialog.showDialog().done(ExtensionManager.updateFromDownload);
Expand Down
9 changes: 5 additions & 4 deletions src/extensibility/InstallExtensionDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ define(function (require, exports, module) {
break;

case STATE_INSTALLING:
url = this.$url.val();
url = $.trim(this.$url.val());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Little nit: I think we can use the native JavaScript trim() function here.

this.$inputArea.hide();
this.$browseExtensionsButton.hide();
this.$msg.text(StringUtils.format(Strings.INSTALLING_FROM, url))
Expand Down Expand Up @@ -297,9 +297,10 @@ define(function (require, exports, module) {
* @private
* Handle typing in the URL field.
*/
InstallExtensionDialog.prototype._handleUrlInput = function () {
var url = this.$url.val(),
valid = (url !== "");
InstallExtensionDialog.prototype._handleUrlInput = function (e) {
var url = this.$url.val(),
trimmedUrl = $.trim(url),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same like above

valid = (trimmedUrl !== "");
if (!valid && this._state === STATE_VALID_URL) {
this._enterState(STATE_START);
} else if (valid && this._state === STATE_START) {
Expand Down